# npm-check-updates

> CLI that upgrades package.json dependencies to their latest versions, preserving semver range operators. Works with npm, yarn, pnpm, deno, and bun.

Stars: 10.3k · Language: TypeScript · License: Apache-2.0 · Categories: Dev Tools

- Repository: https://github.com/raineorshine/npm-check-updates
- Page: https://www.trmn.sh/tools/npm-check-updates

## Install

- npm: `npm install -g npm-check-updates`
- npx: `npx npm-check-updates`

## Overview

npm-check-updates (also available as `ncu`) is a dependency upgrade tool for JavaScript projects. It compares the versions in package.json against the latest published versions, ignoring the ranges currently specified, and lists the available upgrades. Running `ncu -u` rewrites package.json only; you then run `npm install` to update installed packages and the lockfile. `ncu -g` checks globally installed packages.

Upgrades keep existing range operators: `^1.2.0` becomes `^2.0.0`, `1.x` becomes `2.x`, and `*` stays `*`. A "less than" range such as `<2.0.0` is replaced with a caret range. Prerelease versions are ignored unless `--pre` is passed. The `--target` option sets the upgrade level: `semver` (respect existing ranges, including explicit upper bounds), `minor`, `patch`, or a dist-tag such as `@next`. Output is color-coded by upgrade type: red for major (and major version zero), cyan for minor, green for patch.

Packages can be selected with `--filter` or positional arguments (names, wildcards, regex) and excluded with `--reject` or a `!` prefix. `ncu -i` starts an interactive mode where you pick upgrades with arrow keys, space, and Enter. It can be combined with `--format group` and `--interactiveSelect` to control which upgrades are pre-selected. Options can come from the command line or from config files in the current directory, next to package.json, or in `$HOME`. The tool works with npm, yarn, pnpm, deno, and bun, and can be used as a CLI or as a module (pure ESM, also loadable from CommonJS via `require()`). It requires Node.js `^22.22.2 || ^24.15.0 || >=26.0.0` and npm >=10. It suits JavaScript and TypeScript developers who maintain project dependencies.

### Installation

```bash
# via npm
npm install -g npm-check-updates
```

```bash
# via npx
npx npm-check-updates
```

![ncu example output](https://media.trmn.sh/cached/2093e04b710c93d59e550646c1ddf22aa1b0cd981ce8996f2bf0ee01a0190322.png)

![ncu --interactive](https://media.trmn.sh/cached/6f54a0f40947574ef3f92696fb2efdb03d9c54ef18c8dc7bf2000219dd2b2b17.png)

![ncu --interactive --format group](https://media.trmn.sh/cached/de9030320a4bc1704caf56fb1eac69aa7eb18c0baadaa967dc4345213641b9ba.png)

## Alternatives

- [tsx](https://www.trmn.sh/tools/tsx.md): TypeScript Execute (tsx): a CLI for running TypeScript files directly in Node.js. (TypeScript, 12.2k stars)
- [concurrently](https://www.trmn.sh/tools/concurrently.md): Node.js CLI that runs multiple shell commands in parallel with prefixed, colored output and options to kill or restart processes. Works on Windows. (TypeScript, 7.9k stars)
- [Vercel CLI](https://www.trmn.sh/tools/vercel-cli.md): Command-line interface for the Vercel platform: deploy projects, run them locally with vercel dev, and manage deployments from the terminal. (TypeScript, 16.5k stars)
- [Supabase CLI](https://www.trmn.sh/tools/supabase-cli.md): Runs the Supabase stack locally, manages Postgres migrations, deploys Edge Functions, and generates TypeScript types from your database schema. (TypeScript, 2.4k stars)
- [Angular CLI](https://www.trmn.sh/tools/angular-cli.md): Command-line tool for creating, serving, scaffolding, and maintaining Angular applications and workspaces via the ng command. (TypeScript, 27.0k stars)

---

Canonical: https://www.trmn.sh/tools/npm-check-updates
