Updating npm and packages

suggest change

Since npm itself is a Node.js module, it can be updated using itself.

On Windows, a global install into Program Files needs an elevated prompt. A user-level prefix does not.

npm install -g npm@latest

If you want to check for updated versions you can do:

npm outdated

In order to update a specific package:

npm update <package name>

npm update installs the newest version that still satisfies the range already in package.json. It does not move a package to a new major on its own.

In case you also want to lock the updated version in package.json:

npm update <package name> --save

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents