LinuxCommandLibrary

ncu

identifies outdated dependencies in package

TLDR

Check for updates

$ ncu
copy
Update package.json
$ ncu -u
copy
Check specific packages
$ ncu [lodash] [react]
copy
Check packages matching pattern
$ ncu "/^@types/"
copy
Exclude packages
$ ncu --reject [typescript]
copy
Interactive mode
$ ncu -i
copy
Check only minor updates
$ ncu --target minor
copy
Show peer dependencies
$ ncu --peer
copy

SYNOPSIS

ncu [-u] [-i] [--target level] [--reject pattern] [options] [packages]

DESCRIPTION

ncu (npm-check-updates) identifies outdated dependencies in package.json. It shows available updates without installing them.
The tool compares installed versions against npm registry. Output shows current version, wanted version, and latest version for each package.
Update mode (-u) modifies package.json with new versions. Run npm install afterward to actually install updates.
Interactive mode lets you select which packages to update. This is useful when upgrading incrementally or avoiding certain updates.
Target levels control update scope: patch allows only patch updates (1.0.x), minor allows minor (1.x.x), and latest allows any version.
Filter and reject patterns focus on specific packages. Regex patterns match package names.

PARAMETERS

-u, --upgrade

Update package.json.
-i, --interactive
Interactive mode.
-t, --target LEVEL
Update target (latest, minor, patch, semver).
-f, --filter PATTERN
Only include matching packages.
-x, --reject PATTERN
Exclude matching packages.
-g, --global
Check global packages.
-p, --packageManager PM
Package manager (npm, yarn, pnpm).
--peer
Check peer dependencies.
-d, --deep
Check workspaces.
--pre
Include prerelease versions.
--format FMT
Output format.
--doctor
Test upgrades one by one.

CAVEATS

Updates package.json but doesn't install. Breaking changes possible with major updates. Test after updating. Doesn't check actual compatibility.

HISTORY

npm-check-updates was created around 2014 to fill a gap in npm's update workflow. npm update installs updates but doesn't modify package.json, while ncu updates the file for explicit version control.

SEE ALSO

npm(1), yarn(1), pnpm(1), npm-outdated(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community