Node package manager (npm) is a package manager for JavaScript. Package managers automate the process of installing, updating, and deleting software packages.
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.
To discover new releases of the packages, run the following command:
npm outdated
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
To update all global packages on the command line, run the following command:
npm update -g