javascript - How do I update each dependency in package.json to the latest version? -
i copied package.json project , want bump of dependencies latest versions since fresh project , don't mind fixing if breaks.
what's easiest way this?
the best way know of run npm info express version
update package.json manually each one. there must better way.
{ "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 these bumped latest? "mongodb": "~1.2.5", "underscore": "~1.4.2", "rjs": "~2.9.0", "jade": "~0.27.2", "async": "~0.1.22" } }
i collaborator on npm-check-updates, great solution problem.
i have been actively maintaining npm-check-updates last 8 months. v2 released few weeks ago, containing simplified output , many bug fixes , new options. enjoy.
looks npm-check-updates way make happen now.
npm -g npm-check-updates npm-check-updates -u npm install
on npm <3.11:
simply change every dependency's version *
, run npm update --save
. (note: broken in recent (3.11) versions of npm).
"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, blunt hammer of updating dependencies. it's fine if—as said—the project empty , nothing can break.
on other hand, if you're working in more mature project, want verify there no breaking changes in dependencies before upgrading.
to see modules outdated, run npm outdated
. list installed dependencies have newer versions available.
Comments
Post a Comment