Installing Bootstrap 4 alpha with NPM [closed]

2019-03-14 08:54发布

问题:

How can I specifically install the Bootstrap 4 Alpha using NPM. Using npm install bootstrap only installs the current Version 3.3.5.

回答1:

You can download bootstrap v4 alpha version using the git branch v4-dev

npm install bootstrap@4.0.0-alpha.4

or

npm install git://github.com/twbs/bootstrap.git\#v4-dev

or

npm install https://github.com/twbs/bootstrap.git\#v4-dev

or

npm install twbs/bootstrap#v4-dev


回答2:

Use this command

npm install bootstrap@4.0.0-alpha.6


回答3:

You can also install by using the @next tag:

npm install bootstrap@next --save

The @next tag is used by some projects to identify the upcoming version.

One can view the current tag <=> version mapping by using

npm view bootstrap dist-tags

or

npm dist-tag ls bootstrap

and all released bootstrap versions with

npm view bootstrap versions

Tags must share a namespace with version numbers, because they are specified in the same slot: npm install <pkg>@<version> vs npm install <pkg>@<tag>.

More info about the tag system here and here.



回答4:

That doesn't seem to work for me using Node v5 but it does work if you get the tarball directly via http. Downloads really fast too.

npm install https://github.com/twbs/bootstrap/tarball/v4-dev

Or by adding this line to your package.json file, in the dependencies section:

"bootstrap": "https://github.com/twbs/bootstrap/tarball/v4-dev"

It will install successfully:

└── bootstrap@4.0.0-alpha