Updating npm and packages
suggest changeSince 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
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents