Auto-update npm dependencies
Many people still check package.json dependencies manually or via npm outdated. But there is a tool that makes this easier and more convenient: npm-check-updates (ncu).
npm outdated + npm update | ncu | |
|---|---|---|
| Shows available updates | ✅ | ✅ |
| Updates dependencies | ✅ | ✅ |
| Updates above the current range | ❌ | ✅ |
| Ignores specified packages | ❌ | ✅ |
| Filters by type (patch/minor/latest) | ❌ | ✅ |
| Interactive mode | ❌ | ✅ |
Installation
bash
npm install --global npm-check-updatesbash
ncu # show updates
ncu -u # update package.json
npm install # install dependenciesShow updates to a specific level
bash
ncu --target patch
ncu --target minor
ncu --target latestShow updates for specific packages
bash
ncu -f webpack # only webpack
ncu -x webpack # everything except webpackCheck for updates to global dependencies
bash
ncu -gIgnoring packages
json
// .ncurc
{
"reject": ["webpack", "eslint", "@types/*"]
}⚠️ Currently, it is not possible to restrict packages to a specific version range.
npm-check-updates provides complete control, flexibility, and ease of configuration, making it better suited for automating the process.


