[英]Installing a custom version of a package with NPM
Here is my package.json: 这是我的package.json:
{
"private": true,
"devDependencies": {
"axios": "^0.15.2",
"jquery": "^3.1.0",
"laravel-mix": "^0.8",
"lodash": "^4.16.2",
"phantomjs-prebuilt": "^2.1.7",
"vue": "^2.0.1",
"vue-resource": "^0.9.3"
},
"dependencies": {
"vue-clipboard": "0.0.1",
"vue-dragula": "^2.0.0-alpha"
}
}
I have a plugin that is not compatible with vuejs 2.2.4, so I really need to stick with 2.0.1, but when I make a npm install
it install 2.2.4. 我有一个与vuejs 2.2.4不兼容的插件,因此我确实需要坚持使用2.0.1,但是当我进行npm install
,请安装2.2.4。
Why isn't it respecting versioning??? 为什么不尊重版本???
The problem is symbol ^
in package.json file. 问题是package.json文件中的符号^
。 That will automatically install the latest version of package. 这将自动安装最新版本的软件包。 Now the proper way to get around this is adding 现在解决此问题的正确方法是添加
save-exact=true
in ~/.npmrc
which will automatically remove the ^
sign during install. 在~/.npmrc
,它将在安装过程中自动删除^
符号。 This would prevent version change in future for installations of same package. 这样可以防止以后为相同软件包的安装更改版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.