npm-check-updates
$ ncu Community Low Risknpm-check-updates (ncu) inspects package.json dependencies against npm registries without modifying node_modules by default. Its --jsonUpgraded flag emits clean JSON diffs, while --doctor iteratively runs tests to isolate breaking upgrades automatically.
npm install -g npm-check-updates ncu reads local package.json files, respects .npmrc registries, and can run --doctor against local test suites—workflows impractical via MCP.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Read-only by default, emits clean machine-readable --jsonUpgraded and --jsonAll, supports --no-color, and avoids interactive prompts unless -i is passed.
ncu --jsonUpgradedreturns pure JSON key-value upgrade map- Default invocation performs zero file writes unless
-uis explicitly passed
Safe read-only default behavior; -u only edits package.json, and --doctor rolls back breaking upgrades automatically using the project test script.
- Read-only unless
-u(--upgrade) is specified --doctorbisects and reverts failing dependency upgrades
Available globally via npm or zero-install npx npm-check-updates on any machine with Node.js.
- Run directly via
npx npm-check-updatesacross macOS, Linux, and Windows
Solves bulk dependency auditing and targeted semver upgrades (--target minor, --filter) far faster than manual registry lookups.
- Supports workspace (
--workspaces) and semver-target filtering in one pass
Long-running community project (raineorshine/npm-check-updates) under Apache-2.0 with consistent maintenance.
- Established
raineorshine/npm-check-updatesrepository
Thorough README option reference and clear --help output.
- Complete CLI flags documented in README and
--help
Security, Auth & Guardrails
Public registry checks require no auth; private registries inherit credentials from .npmrc.
Apache-2.0 open-source CLI; free to use against npm and private registries.
# npm-check-updates (ncu) Agent Rules - Always run `ncu --jsonUpgraded` (read-only) before passing `-u`. - Prefer `--target minor` or `--doctor -u` when upgrading dependencies autonomously.
Agent-Ready Command Recipes
Safe Read-Only Queries
ncu --jsonUpgraded
Read-only check returning a JSON map of upgradable package names to target versions.
ncu --target minor --jsonUpgraded
Filters out major breaking bumps and outputs safe minor/patch candidates in JSON.
Controlled Writes & Previews
ncu -u --target minor --jsonUpgraded
Writes minor/patch version updates into package.json without running npm install.
Strengths for Agents
- + Read-only by default and supports
--jsonUpgradedfor clean JSON parsing. - +
--doctorautomates upgrade-test-rollback bisection for breaking dependencies. - +
--target minor/--target patchand--filterconstrain upgrade blast radius.
Caveats & Pitfalls
- ! Requires Node.js runtime and network access to the configured npm registry.
- ! Updating
package.jsonwith-ustill requires a separatenpm/pnpm/yarninstall to refresh lockfiles.