npm安装时--save-dev如何让保存在package.json中的semver以~开头,而不是^开头 ?
比如我执行了
npm install --save-dev del
后,package.json里自动在
devDependencies
添加了一条依赖,但是我不希望他是以
^
开头,我希望他默认是以
~
开头。这个需要什么特殊设置吗
{
"name": "xxx",
"version": "0.1.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "xxxx",
"license": "MIT",
"devDependencies": {
"del": "^1.1.1"
}
}
希望执行完安装命令后是这样的结果
{
"name": "xxx",
"version": "0.1.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "xxxx",
"license": "MIT",
"devDependencies": {
"del": "~1.1.1"
}
}
哆啦炼金术师
10 years, 5 months ago