• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2title: npm-deprecate
3section: 1
4description: Deprecate a version of a package
5---
6
7### Synopsis
8
9```bash
10npm deprecate <package-spec> <message>
11```
12
13Note: This command is unaware of workspaces.
14
15### Description
16
17This command will update the npm registry entry for a package, providing a
18deprecation warning to all who attempt to install it.
19
20It works on [version ranges](https://semver.npmjs.com/) as well as specific
21versions, so you can do something like this:
22
23```bash
24npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3"
25```
26
27SemVer ranges passed to this command are interpreted such that they *do*
28include prerelease versions.  For example:
29
30```bash
31npm deprecate my-thing@1.x "1.x is no longer supported"
32```
33
34In this case, a version `my-thing@1.0.0-beta.0` will also be deprecated.
35
36You must be the package owner to deprecate something.  See the `owner` and
37`adduser` help topics.
38
39To un-deprecate a package, specify an empty string (`""`) for the `message`
40argument. Note that you must use double quotes with no space between them to
41format an empty string.
42
43### Configuration
44
45#### `registry`
46
47* Default: "https://registry.npmjs.org/"
48* Type: URL
49
50The base URL of the npm registry.
51
52
53
54#### `otp`
55
56* Default: null
57* Type: null or String
58
59This is a one-time password from a two-factor authenticator. It's needed
60when publishing or changing package permissions with `npm access`.
61
62If not set, and a registry response fails with a challenge for a one-time
63password, npm will prompt on the command line for one.
64
65
66
67### See Also
68
69* [package spec](/using-npm/package-spec)
70* [npm publish](/commands/npm-publish)
71* [npm registry](/using-npm/registry)
72* [npm owner](/commands/npm-owner)
73* [npm adduser](/commands/npm-adduser)
74