pnpm outdated
Checks for outdated packages, runtimes (node, deno, bun declared in
devEngines.runtime, engines.runtime, or through the runtime: / tool:
protocol), package managers (pnpm, npm, yarn, bun declared in
devEngines.packageManager or packageManager), Cargo crates (Cargo.toml
when cargo.enabled is true), and Python packages
(pyproject.toml when python.enabled is
true). The check can be limited to a subset of the declared dependencies,
runtimes, or package managers by providing arguments, including crate:<name>
for Cargo crates and pypi:<name> for Python packages. Patterns support *
wildcards, and a leading ! excludes matching names. Python selectors ignore case and treat runs of dots, underscores, and hyphens as one hyphen. Cargo selectors match both the dependency alias and the crate name.
Since v12.25.0, with cargo.enabled, pnpm outdated also lists the Rust
release that a toolchain file pins, as rust,
when a newer release of its channel is out. Select it with rust or leave it
out with !rust. --compatible does not list it, because a pinned release
moves only with pnpm update --latest.
pnpm outdated exits with code 1 when any dependency is outdated.
Without a lockfile, the Current column shows the version installed in
node_modules. 如果依赖未安装,则显示声明的范围所允许的最低版本。 Cargo 和 Python 检查仍然需要各自的生态锁文件。
The Latest column shows the highest of the version the declared specifier
resolves to and the version the latest dist-tag points to. If the installed
version is a prerelease, pnpm also considers the dist-tag that points to the
newest version of the same prerelease channel, such as next pointing to
3.0.0-rc.1 when 3.0.0-rc.0 is installed. pnpm update --latest does not
follow prerelease channel dist-tags.
示例:
pnpm outdated
pnpm outdated "*gulp-*" @babel/core
配置项#
--recursive, -r#
在子目录发现的所有包中,或者在一个工作空间执行时在所有工作空间包中检查过期依赖。
--filter <package_selector>#
--global, -g#
列出过时的全局包。
--long#
打印详细信息。
--format <format>#
- 默认值:true
- 类型:table、list、json
以给定格式打印已经过期的依赖项。
--json#
Shorthand for --format json.
--no-table#
Shorthand for --format list.
--compatible#
仅打印满足 package.json 规范的版本。
--dev, -D#
仅检查 devDependencies。
--prod, -P, --production#
仅检查 dependencies 和 optionalDependencies。
--no-optional#
不去检查 optionalDependencies。
--optional#
Checks optionalDependencies.
--sort-by#
指定输出结果的排序顺序。目前只接受值 name。默认情况下,结果先按版本变化的幅度排序,再按名称排序。
--notes#
Print the release notes between the current and the latest version below each outdated package. Notes are read from registries declared with serverType: pnpr. The notes of a release that published several packages are printed once, above the notes of the versions it published. Between two stable versions, the notes of prereleases are left out. With --json, each entry gets a releaseNotes field.
--include-github-actions#
此外,请检查该仓库工作流文件中引用的 GitHub Actions 是否有更新。在 pnpm-workspace.yaml 中把 update.githubActions 设为 true 即可默认启用它。参见更新 GitHub Actions。