npm outdated — check for package updates
Quick Answer
# List outdated packages
npm outdated
# Update all packages to latest compatible version (respects semver)
npm update
# Update a specific package
npm update lodash
Usage
You want to check if your dependencies have newer versions available.
Other causes & fixes
Reading npm outdated output
npm outdated
# Package Current Wanted Latest Location
# lodash 4.17.20 4.17.21 4.17.21 node_modules/lodash
# react 17.0.2 17.0.2 18.3.0 node_modules/react
#
# Current: installed version
# Wanted: latest that satisfies your package.json range
# Latest: latest published on npm
Upgrade to latest (beyond semver range)
# Install latest explicitly
npm install lodash@latest
# Or use npm-check-updates to bump package.json
npx npm-check-updates -u
npm install
Check global packages
npm outdated -g
Related