How to update packages using npm

Node package manager (npm) is a package manager for JavaScript. Package managers automate the process of installing, updating, and deleting software packages.​

svg viewer

When a package is installed using npm install <packagename>, the latest available version of the package is downloaded and put in the node_modules folder; a corresponding entry is then added to the package.json and package-lock.json files.

Check outdated packages

To discover new releases of the packages, run the following command:

npm outdated

Upgrade packages

The following command will update all the packages to the latest minor version. New major versions may introduce changes that could break the project or the command may install missing packages:

npm update --save

Updating all globally-installed packages

To update all global packages on the command line, run the following command:

npm update -g
New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
πŸ† Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources

Copyright Β©2025 Educative, Inc. All rights reserved