目录
选择命令行版本:
目录
概要
¥Synopsis
npm deprecate <package-spec> <message>
注意:此命令对工作区无感知。
¥Note: This command is unaware of workspaces.
描述
¥Description
此命令将更新包的 npm 注册表项,向所有尝试安装它的人提供弃用警告。
¥This command will update the npm registry entry for a package, providing a deprecation warning to all who attempt to install it.
它适用于 版本范围 以及特定版本,因此你可以执行以下操作:
¥It works on version ranges as well as specific versions, so you can do something like this:
npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3"
传递给此命令的 SemVer 范围被解释为包含预发布版本。例如:
¥SemVer ranges passed to this command are interpreted such that they do include prerelease versions. For example:
npm deprecate my-thing@1.x "1.x is no longer supported"
在这种情况下,版本 my-thing@1.0.0-beta.0
也将被弃用。
¥In this case, a version my-thing@1.0.0-beta.0
will also be deprecated.
你必须是包所有者才能弃用某些东西。请参阅 owner
和 adduser
帮助主题。
¥You must be the package owner to deprecate something. See the owner
and adduser
help topics.
要取消弃用包,请为 message
参数指定一个空字符串 (""
)。请注意,你必须使用不带空格的双引号来格式化空字符串。
¥To un-deprecate a package, specify an empty string (""
) for the message
argument. Note that you must use double quotes with no space between them to format an empty string.
配置
¥Configuration
registry
-
默认值:"https://registry.npmjs.org/"
¥Default: "https://registry.npmjs.org/"
-
类型:URL
¥Type: URL
npm 注册表的基本 URL。
¥The base URL of the npm registry.
otp
-
默认值:null
¥Default: null
-
类型:空值或字符串
¥Type: null or String
这是来自双重身份验证器的一次性密码。使用 npm access
发布或更改包权限时需要它。
¥This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with npm access
.
如果未设置,并且注册表响应失败并询问一次性密码,npm 将在命令行上提示输入一次密码。
¥If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one.
也可以看看
¥See Also