How to Upgrade All NPM Packages in a Project using ncu
If you're working on a Node.js or Next.js project and want to upgrade all your dependencies to their latest versions, here's a quick reminder guide using npm-check-updates
(ncu).
Step 1: Install npm-check-updates
Globally
npm install -g npm-check-updates
Step 2: Check for Available Package Updates
ncu
This shows you which packages in your package.json are outdated.
Step 3: Update package.json with the Latest Versions
ncu -u
This installs the updated versions into your node_modules.
(Optional) Clean Install
rm -rf node_modules package-lock.json
npm install
Useful if you want a clean dependency tree after upgrading.
Top comments (0)