什么是 npm i bootstrap@next?

Nav*_*een 7 angular-bootstrap angular-cli ng-bootstrap

当我在 angularjs 2 中配置 bootstrap 时,我在此链接中遇到了以下步骤,

如何将 bootstrap 添加到 angular-cli 项目

npm i bootstrap@next
Run Code Online (Sandbox Code Playgroud)

我明白如果我们运行以下命令,

npm i -S bootstrap@4.0.0-alpha.4 
Run Code Online (Sandbox Code Playgroud)

然后这将安装 bootstrap alpha 版本。但是如果我们给出@next,将安装哪个版本?

还有 --save 和 @next 之类的,

npm i bootstrap@next --save
Run Code Online (Sandbox Code Playgroud)

推荐哪个?以及我们如何确认已安装版本的版本?

Ahm*_*lam 9

在 NPM 包名称后面使用@表示版本或标签

尝试npm view bootstrap你会得到这个输出:

请注意该标签next适用于版本4.0.0-alpha.6

该view命令的文档: https: //docs.npmjs.com/cli/view

{ name: 'bootstrap',
  description: 'The most popular front-end framework for developing responsive, mobile first projects on the web.',
  'dist-tags': { latest: '3.3.7', next: '4.0.0-alpha.6' },
  versions: 
   [ '0.0.1',
     '0.0.2',
     '3.1.1',
     '3.2.0',
     '3.3.0',
     '3.3.1',
     '3.3.2',
     '3.3.4',
   ...
Run Code Online (Sandbox Code Playgroud)

至于--save或者-S它们都是同一事物的别名,请在此处阅读更多信息: https: //docs.npmjs.com/cli/install 来自npm install上面的文档链接:

-S, --save:包将出现在您的依赖项中。