DEV Community

Keanu Dirkse
Keanu Dirkse

Posted on

How to update your npm packages with npm-check

A quick guide to updating all of your outdated npm packages using npm-check

How to use npm-check

See what is outdated

npx npm-check
Enter fullscreen mode Exit fullscreen mode

npm-check is a tool that checks for outdated, incorrect, and unused dependencies. This will tell you if anything needs updating. The above command will run the tool via npx.

NPX stands for Node Package execute. It allows developers to run any Javascript package on NPM without needing to install the package first

screenshot of npx npm-check output

Update packages via npm-check

Interactive update

npx npm-check -u
Enter fullscreen mode Exit fullscreen mode

This allows you to choose which packages to update

screenshot of npx npm-check -u output

Update all

npx npm-check -y
Enter fullscreen mode Exit fullscreen mode

This will update all your packages without prompting you. Use with caution as some updates may include breaking changes

Updating using npm update

npm update --save
Enter fullscreen mode Exit fullscreen mode

This updates the package.json to use the latest versions of their dependencies. It is worth noting that this will avoid updating to a major breaking change version.

Top comments (0)