[英]Specifing semver operator for npm install --save
By default npm install --save
uses ^
as the semver operator. 默认情况下,
npm install --save
使用^
作为semver运算符。 I know that this default can be changed using setting the save-prefix
config. 我知道可以通过设置
save-prefix
配置来更改此默认设置。 But since I want to specify ~
for dependencies and ^
for devDependencies, I don't want to change the config. 但是由于我想为依赖项指定
~
,为devDependencies指定^
,所以我不想更改配置。 Is there a way to specify the ~
operator with the --save
command? 是否可以通过
--save
命令指定~
运算符?
Use: npm install <package> --save --save-prefix='<prefix>'
使用:
npm install <package> --save --save-prefix='<prefix>'
For example: npm install gulp --save --save-prefix='~'
例如:
npm install gulp --save --save-prefix='~'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.