
Here's the correct way to update dependencies using only npm from the command line. Semantic versioning screws things just enough, so it's safer to manually edit package.json than to attempt npm acrobatics. It's hard to update a new version of a library. Make sure you back up the dependencies list before you do, though.Īnd that’s how you update all npm packages installed as dependencies on your project.Updating to close-by version with npm update

Repeat this until all packages are updated to the latest major version.īut of course, you are free to run ncu -u if you want to. Once you’re certain the application is running fine, update another package. Update one package, then check if the update causes any issue. The safer way to update major package versions is to use the npm install command. The reason why npm update follows the semantic rules is to help you transition any package update gracefully, letting you inspect the application for any issue.

This is because updating the major version of multiple packages at once could break your application.

I don’t recommend you to use npm-check-updates, however.

Once done, you need to run npm install to get the latest versions.
