pnpm deprecate

对已发布的软件包版本设置弃用消息。运行 pnpm install 的用户在安装匹配版本时会看到此消息。

pnpm deprecate <pkg>[@<version-range>] <message>

To clear a deprecation message, use pnpm undeprecate. An empty message fails with ERR_PNPM_DEPRECATE_MESSAGE_REQUIRED.

示例#

弃用单个版本:

pnpm deprecate foo@1.0.0 "Use foo@2 instead"

弃用多个版本:

pnpm deprecate "foo@<2" "Please upgrade to foo@2"

弃用所有版本:

pnpm deprecate foo "This package is no longer maintained"

配置项#

--registry <url>#

The registry to write the deprecation to. 默认使用为该软件包配置的注册源。

--otp <code>#

When the registry requires two-factor authentication, supply the one-time password via this flag.

pnpm undeprecate#

从软件包版本中移除弃用信息。

pnpm undeprecate <pkg>[@<version-range>]