← 返回命令列表

Linux command

npm-outdated 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Check outdated packages

npm outdated

Check global packages

npm outdated -g

Output as JSON

npm outdated --json

Check specific package

npm outdated [package]

Long format output

npm outdated --long

Include nested (transitive) dependencies

npm outdated --all

Parseable tab-separated output

npm outdated --parseable

说明

npm outdated checks the registry for newer versions of installed packages. It reports the currently installed version, the maximum version satisfying the semver range in package.json (wanted), and the latest version tagged in the registry (latest). Color coding in terminal output: red indicates an available update within your semver range (safe to run `npm update`); yellow indicates a newer version exists that exceeds your semver range (requires a manual bump).

参数

-g, --global
Check globally installed packages instead of the local project.
--json
Output as JSON (machine-parseable).
-l, --long
Extended output including package type (dependencies, devDependencies, peerDependencies, optionalDependencies) and homepage.
-p, --parseable
Tab-separated output suitable for parsing.
--all
Show all outdated packages, including meta-dependencies (transitive/nested), not just direct dependencies.
--omit _type_
Exclude a dependency group (dev, optional, peer). May be set multiple times.
-w, --workspace _name_
Run the command within the named workspace(s).
-ws, --workspaces
Run across all configured workspaces.
--include-workspace-root
Include the workspace root when running with --workspaces.

FAQ

What is the npm-outdated command used for?

npm outdated checks the registry for newer versions of installed packages. It reports the currently installed version, the maximum version satisfying the semver range in package.json (wanted), and the latest version tagged in the registry (latest). Color coding in terminal output: red indicates an available update within your semver range (safe to run `npm update`); yellow indicates a newer version exists that exceeds your semver range (requires a manual bump).

How do I run a basic npm-outdated example?

Run `npm outdated` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -g, --global do in npm-outdated?

Check globally installed packages instead of the local project.