How do I update devDependencies in NPM?


Question

npm update seems to just update the packages in dependencies, but what about devDependencies.

Right now you can install devDependencies by running npm install ., but this doesn't work for npm update .

Any ideas?

1
133
1/17/2016 10:09:55 AM

Accepted Answer

To update package.json in addition to the local modules, run

npm update --save-dev

Alternatively, the same command to save time

npm update -D

You can view the full detail of update, or any command for that matter through

npm help <cmd>
133
7/18/2017 4:50:34 PM

Install npm-check-updates (https://www.npmjs.org/package/npm-check-updates), then jump into your project folder and run:

npm-check-updates

And to update and save changes to your package.json file:

npm-check-updates -u

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon