By default npm install --save
uses ^
as the semver operator. I know that this default can be changed using setting the save-prefix
config. But since I want to specify ~
for dependencies and ^
for devDependencies, I don't want to change the config. Is there a way to specify the ~
operator with the --save
command?
Use: npm install <package> --save --save-prefix='<prefix>'
For example: npm install gulp --save --save-prefix='~'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.