2025-04-10 14:36:22 -07:00
.TH "NPM-DEPRECATE" "1" "April 2025" "NPM@11.3.0" ""
2011-11-26 09:21:03 -08:00
.SH "NAME"
2022-12-06 22:18:33 -05:00
\fB npm-deprecate\fR - Deprecate a version of a package
.SS "Synopsis"
2014-09-24 14:41:07 -07:00
.P
.RS 2
2014-11-04 15:08:12 -08:00
.nf
2022-12-06 22:18:33 -05:00
npm deprecate <package-spec> <message>
2014-11-04 15:08:12 -08:00
.fi
2014-09-24 14:41:07 -07:00
.RE
2021-03-23 14:58:11 -04:00
.P
2022-12-06 22:18:33 -05:00
Note: This command is unaware of workspaces.
.SS "Description"
2014-09-24 14:41:07 -07:00
.P
2022-12-06 22:18:33 -05:00
This command will update the npm registry entry for a package, providing a deprecation warning to all who attempt to install it.
2011-11-26 09:21:03 -08:00
.P
2022-12-06 22:18:33 -05:00
It works on \fB version ranges\fR \fI \(la https://semver.npmjs.com/\(ra \fR as well as specific versions, so you can do something like this:
2014-09-24 14:41:07 -07:00
.P
.RS 2
2014-11-04 15:08:12 -08:00
.nf
2022-12-06 22:18:33 -05:00
npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3"
2014-11-04 15:08:12 -08:00
.fi
2014-09-24 14:41:07 -07:00
.RE
2011-11-26 09:21:03 -08:00
.P
2022-12-06 22:18:33 -05:00
SemVer ranges passed to this command are interpreted such that they \fI do\fR include prerelease versions. For example:
2020-12-18 15:39:05 -05:00
.P
.RS 2
.nf
2022-12-06 22:18:33 -05:00
npm deprecate my-thing@1.x "1.x is no longer supported"
2020-12-18 15:39:05 -05:00
.fi
.RE
.P
2022-12-06 22:18:33 -05:00
In this case, a version \fB my-thing@1.0.0-beta.0\fR will also be deprecated.
2020-12-18 15:39:05 -05:00
.P
2022-12-06 22:18:33 -05:00
You must be the package owner to deprecate something. See the \fB owner\fR and \fB adduser\fR help topics.
2012-12-21 16:42:29 +00:00
.P
2022-12-06 22:18:33 -05:00
To un-deprecate a package, specify an empty string (\fB ""\fR ) for the \fB message\fR argument. Note that you must use double quotes with no space between them to format an empty string.
.SS "Configuration"
.SS "\fBregistry\fR"
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
Default: "https://registry.npmjs.org/"
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: URL
2022-12-06 22:18:33 -05:00
.RE 0
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
The base URL of the npm registry.
.SS "\fBotp\fR"
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Default: null
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: null or String
2022-12-06 22:18:33 -05:00
.RE 0
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fB npm access\fR .
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
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.
2025-02-02 07:09:59 -08:00
.SS "\fBdry-run\fR"
.RS 0
.IP \(bu 4
Default: false
.IP \(bu 4
Type: Boolean
.RE 0
.P
Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fB install\fR , \fB update\fR , \fB dedupe\fR , \fB uninstall\fR , as well as \fB pack\fR and \fB publish\fR .
.P
Note: This is NOT honored by other network related commands, eg \fB dist-tags\fR , \fB owner\fR , etc.
2022-12-06 22:18:33 -05:00
.SS "See Also"
2014-09-24 14:41:07 -07:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2022-11-07 13:02:05 -05:00
npm help "package spec"
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help publish
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-05 14:55:08 -05:00
npm help registry
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-10 17:31:02 -04:00
npm help owner
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-09-09 20:01:11 +00:00
npm help adduser
2022-12-06 22:18:33 -05:00
.RE 0