Use npm-check-updates to update all package.json to latest versions and npm update

Tadashi Shigeoka ·  Thu, July 27, 2017

I’ll introduce the procedure for updating all npm module versions listed in package.json to the latest and running npm update in Node.js.

npm | エヌピーエム

Install npm-check-updates

The npm-check-updates module can update packages listed in package.json to their latest versions, so first install this.

npm install -g npm-check-updates

Update package.json using npm-check-updates

To update package.json using the installed npm-check-updates, run it with the —upgrade or -u option.

npm-check-updates --upgrade

# ncu is an alias command for npm-check-updates
ncu -u 

Additionally, to include minor version updates as targets, run with the —upgradeAll or -a option to include middle version and minor version changes as npm update targets.

npm-check-updates --upgradeAll

# alias ver
ncu -a

That’s the method for updating node modules listed in package.json to their latest versions using npm-check-updates.

Reference Information

That’s all from the Gemba.