How to update the npm version bundled with your Node.js installation
The npm application is a package manager that’s bundled with the Node.js server.
When you install Node.js, you will get a certain version of npm installed on your computer.
Because Node.js release new versions at a slower pace than npm, the included npm version can be outdated after a while.
When you want to update the npm package, run the command npm install -g npm@latest.
Here’s an example of updating npm from version 6 to version 8:
$ npm -v
6.14.17
$ npm install -g npm@latest
+ [email protected]
$ npm -v
8.12.1
As of this writing, the latest version of npm is version 8, so it was installed.
The latest stable version should be installed when you run the command in the future.
And that’s how you update the npm application included with your Node.js server.
More npm tutorials
See allnpm
How to publish a package to npm
Jul 1, 2022
npm
How to run your Node server continuously with forever
Jun 30, 2022
npm
How to reinstall npm successfully
Jun 30, 2022
npm
How to check and update npm package using npm outdated
Jun 29, 2022
npm
How to fix npm live-server: command not found error
Jun 29, 2022