NPM 更新所有依赖项
Posted 漫步云端
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了NPM 更新所有依赖项相关的知识,希望对你有一定的参考价值。
Simply change every dependency‘s version to *
, then run npm update --save
.
"dependencies": {
"express": "*",
"mongodb": "*",
"underscore": "*",
"rjs": "*",
"jade": "*",
"async": "*"
}
After:
"dependencies": {
"express": "~3.2.0",
"mongodb": "~1.2.14",
"underscore": "~1.4.4",
"rjs": "~2.10.0",
"jade": "~0.29.0",
"async": "~0.2.7"
}
Of course, this is the blunt hammer of updating dependencies. It‘s fine if—as you said—the project is empty and nothing can break.
On the other hand, if you‘re working in a more mature project, you probably want to verify that there are no breaking changes in your dependencies before upgrading.
To see which modules are outdated, just run npm outdated
. It will list any installed dependencies that have newer versions available.
以上是关于NPM 更新所有依赖项的主要内容,如果未能解决你的问题,请参考以下文章
使用 package-lock.json 更新中间 npm 依赖项
解决未能加载文件或程序集“Newtonsoft.Json ...."或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)(代码片段