1 ---
2 title: npm-deprecate
3 section: 1
4 description: Deprecate a version of a package
5 github_repo: npm/cli
6 github_branch: latest
7 github_path: docs/lib/content/commands/npm-deprecate.md
8 redirect_from:
9 - /cli-commands/deprecate
10 - /cli-commands/npm-deprecate
11 - /cli-documentation/cli-commands/deprecate
12 - /cli-documentation/cli-commands/npm-deprecate
13 - /cli-documentation/commands/deprecate
14 - /cli-documentation/commands/npm-deprecate
15 - /cli-documentation/deprecate
16 - /cli-documentation/npm-deprecate
17 - /cli-documentation/v11/cli-commands/deprecate
18 - /cli-documentation/v11/cli-commands/npm-deprecate
19 - /cli-documentation/v11/commands/deprecate
20 - /cli-documentation/v11/commands/npm-deprecate
21 - /cli-documentation/v11/deprecate
22 - /cli-documentation/v11/npm-deprecate
23 - /cli/cli-commands/deprecate
24 - /cli/cli-commands/npm-deprecate
25 - /cli/commands/deprecate
26 - /cli/commands/npm-deprecate
27 - /cli/deprecate
28 - /cli/npm-deprecate
29 - /cli/v11/cli-commands/deprecate
30 - /cli/v11/cli-commands/npm-deprecate
31 - /cli/v11/commands/deprecate
32 - /cli/v11/deprecate
33 - /cli/v11/npm-deprecate
34 - /commands/deprecate
35 - /commands/npm-deprecate
36 ---
37
38 ### Synopsis
39
40 ```bash
41 npm deprecate <package-spec> <message>
42 ```
43
44 Note: This command is unaware of workspaces.
45
46 ### Description
47
48 This command will update the npm registry entry for a package, providing a deprecation warning to all who attempt to install it.
49
50 It works on [version ranges](https://semver.npmjs.com/) as well as specific versions, so you can do something like this:
51
52 ```bash
53 npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3"
54 ```
55
56 SemVer ranges passed to this command are interpreted such that they _do_ include prerelease versions. For example:
57
58 ```bash
59 npm deprecate my-thing@1.x "1.x is no longer supported"
60 ```
61
62 In this case, a version `my-thing@1.0.0-beta.0` will also be deprecated.
63
64 You must be the package owner to deprecate something. See the `owner` and `adduser` help topics.
65
66 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.
67
68 ### Configuration
69
70 #### `registry`
71
72 - Default: "https://registry.npmjs.org/"
73 - Type: URL
74
75 The base URL of the npm registry.
76
77 #### `otp`
78
79 - Default: null
80 - Type: null or String
81
82 This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with `npm access`.
83
84 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.
85
86 #### `dry-run`
87
88 - Default: false
89 - Type: Boolean
90
91 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, `install`, `update`, `dedupe`, `uninstall`, as well as `pack` and `publish`.
92
93 Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc.
94
95 ### See Also
96
97 - [package spec](/cli/v11/using-npm/package-spec)
98 - [npm publish](/cli/v11/commands/npm-publish)
99 - [npm registry](/cli/v11/using-npm/registry)
100 - [npm owner](/cli/v11/commands/npm-owner)
101 - [npm adduser](/cli/v11/commands/npm-adduser)