DEV Community

Cover image for Update All NPM Dependencies
Sabbir Zzaman
Sabbir Zzaman

Posted on

2 1 1 1 1

Update All NPM Dependencies

Dependencies and packages are getting updates and as a developer, it's important for you to keep your dependencies up-to-date. Today you will meet an amazing tool to keep your applications dependencies up-to-date.

Before getting started I always recommend you create a new branch before updating dependencies and test your application after updating dependencies. Then merge the branch with main branch.

Installing npm-check-updates

First, you need to install npm-check-updates in your machine globally. You can do this by running the following command in your terminal:

npm install -g npm-check-updates
Enter fullscreen mode Exit fullscreen mode

Using npm-check-updates

Now that you have npm-check-updates installed. To get started open your terminal and navigate to your project directory and run the following command.

ncu -u
Enter fullscreen mode Exit fullscreen mode

This will check for the latest versions of all your project's dependencies and then update your dependencies from package.json file with the latest version numbers. It will just replace the numbers not actually install the new versions.

Updated dependencies

Now just run the command npm install to install the updated dependencies. That's it! You have now successfully updated your npm dependencies using npm-check-updates.

Keeping your dependencies up-to-date is important for the security and functionality of your code. With npm-check-updates, this task becomes much easier and faster.

Thanks for reading!

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay