如何将Package.json中的每个依赖项更新为最新版本?我从另一个项目中复制了Package.json,现在我想将所有的依赖项都添加到它们的最新版本,因为这是一个新的项目,如果它坏了,我不介意修复它。做这件事最简单的方法是什么?我现在所知道的最好的方法就是跑npm info express version然后手动更新Package.json。一定有更好的办法。{
"name": "myproject",
"description": "my node project",
"version": "1.0.0",
"engines": {
"node": "0.8.4",
"npm": "1.1.65"
},
"private": true,
"dependencies": {
"express": "~3.0.3", // how do I get these bumped to latest?
"mongodb": "~1.2.5",
"underscore": "~1.4.2",
"rjs": "~2.9.0",
"jade": "~0.27.2",
"async": "~0.1.22"
}}更新5/1/19六年后,我仍然坚持NPM-检查更新作为这个问题的综合解决方案。好好享受吧!
3 回答
米脂
TA贡献1836条经验 获得超3个赞
npm i -g npm-check-updates ncu -u npm install
*npm update --save. (注:
"dependencies": {
"express": "*",
"mongodb": "*",
"underscore": "*",
"rjs": "*",
"jade": "*",
"async": "*"
} "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"
}npm outdated
添加回答
举报
0/150
提交
取消
