How to automate Node projects packages updates
Whether it's a website built with Grunt or Gulp, or just any other Node project, the package updates can be automated with npm-check-updates. I can tell you, it's super handy!
For instance, if you want to update project’s Grunt or Gulp packages, you need to go to the
packages.json file and manually update the version number to each package and then run
$ npm update. Tedious, boring, repetative.
npm-check-updates does what it says, checks for new versions and updates your
package.json file accordingly.
Install it globally (
$ npm install -g npm-check-updates
cd into your project and check for updates:
This’ll spew out a list of outdated packages for you to inspect. Then update the packages file:
$ npm-check-updates -u
Then use the npm’s built in update command:
$ npm update
And there you have it, nice and easy.
I tried this and couldn’t get the
npm-update to work, I reinstalled node and it helped.