Update all node dependencies to their latest version without updating one by one

Photo by Andrew Neel on Unsplash

This process will sometimes trouble you at some point. Because software maintenance & upgrade will cost a lot; unless we are aware of what we are doing.

In this post, I wanted to bookmark myself the process of updating all node dependencies in the package.json file to their latest version without updating each dependency one by one.

The above command will give the outdated dependencies and their available latest versions. To update one by one we need to execute the following command

But, if you know that you can able to handle the version issue by upgrading all the dependencies to the latest version then follow the below instructions.

To update to a new major version of all the packages, install the npm-check-updates package globally:

then run it:

After running the above command, you will see in the package.json devDependencies & dependencies are updated with the latest version. Now, run the below command to update the versions in the node_modules folder.

If you don’t have node_modules created in the project? then run the following command to install node_modules of the project.

Happy coding…!!

--

--

A passionate in Tech https://www.linkedin.com/in/parathantl

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store