User Tools

Site Tools


NPM Cheat Sheet

npm install Install missing packages.
npm list -g --depth=0 List globally installed packages.
npm uninstall -g [package_name] Uninstall a global package.
npm outdated List outdated packages.
npm update This will update the package-lock.json file but not the package.json file.

Updating Packages

The easiest way is to use the npm-check-updates package. Yes, that is correct - NPM's update is so bad, you need to use a seperate package to make it work better…

npm install -g npm-check-updates Installs npm-check-updates
npm-check-updates Lists what packages are out of date (basically the same thing as running npm outdated)
npm-check-updates -u Updates all the versions in your package.json file.
npm update To install the new versions of your packages based on the updated package.json file.

For global packages:

npm-check-updates -g (Run as admin) Lists what global packages are out of date and gives the command to update them.
npm_cheat_sheet.txt · Last modified: 2021/08/28 23:47 by stephen