update all packages in package.json code example
Example 1: upgrade all packages in package.json
npm install -g npm-check-updates
ncu -u
npm install
Example 2: npm update
npm install -g npm@latest
Example 3: how to update my package.json
npm install -g npm-check-updates
/after install run following:
ncu -u
//Then this:
npm update
Example 4: how to update node modules
npm install --global upgrade-node-modules
Example 5: update node.js dependencies
npm install -g npm-check-updates
ncu -u
npm update
npm install
Example 6: update all packages in package.json
//To install major updates globally
npm install -g npm-check-updates
//To see a list of outdated packages
npm outdated
//To update the packages to their latest versions in package.json
ncu -u
//To install the new updates
npm update or npm install