“npm -d install”中的“-d”是什么?

时间:2012-01-09 02:10:23

标签: npm

我看到一些帖子提到使用npm参数运行-d。例如,this issue指的是执行npm -d install coffee-scripta few other pages也引用了这种语法,包括至少一个npm包的install instructions

但我一直无法找到此-d参数的任何文档。 docs for npm install未提及-d,也未提及the npm FAQ,也未提及我查看的任何其他文档页面。

-d选项可以执行任何操作吗?如果是这样,是什么?

3 个答案:

答案 0 :(得分:73)

如果其他人从网络搜索结束此处,则-d标志与大写字母-D不同,后者是--save-dev的标志同义词。

答案 1 :(得分:70)

看起来更难! :)

https://docs.npmjs.com/misc/config#shorthands-and-other-cli-niceties

这是--loglevel info

的捷径

答案 2 :(得分:-1)

好吧,这让我感到困惑,但是当npm install发出错误消息npm install -d救了我很多时间时。
-d标志用于在本地强制安装npm --save用于将更新的软件包保存在package.json文件中

npm install -d --save 

另一方面,npm -D略有不同。根据{{​​3}},-D是--save-dev

的同义词
aliases: npm i, npm add
common options: [-P|--save-prod|-D|--save-dev|-O|--save-optional] [-E|--save-exact] [-B|--save-bundle] [--no-save] [--dry-run]