码迷,mamicode.com
首页 > 其他好文 > 详细

NPM 更新所有依赖项

时间:2016-06-29 23:32:45      阅读:302      评论:0      收藏:0      [点我收藏+]

标签:

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 更新所有依赖项

标签:

原文地址:http://www.cnblogs.com/traffic/p/5628444.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!