How to Update a Node Dependency with NPM
It's important to keep your dependencies up-to-date in your package.json file. When relying on 3rd-party code you want to make sure you're pulling in security fixes, performance improvements, and general bug fixes. However, since your project's package-lock.json file pins a specific version of a package you'll occasionally need to update those records to pull in the latest compatible version, test it, and deploy it to your project.
In this tutorial we'll:
npm outdatedto get a list of a project's dependencies that can be updated
- Update an existing Node dependency to a new version
- Update an existing Node dependency to a new major version
By the end of this tutorial, you'll be able to update dependency versions in your package.json file with npm.
Sign in with your Osio Labs account
to gain instant access to our entire library.