reggi/overrides
@reggi/path-to-regexp
dependabot/npm_and_yarn/main/copy-to-clipboard-4.0.2
dependabot/npm_and_yarn/main/eslint-10.4.0
dependabot/npm_and_yarn/main/npmcli/eslint-config-7.0.0
dependabot/npm_and_yarn/main/proc-log-7.0.0
dependabot/npm_and_yarn/npm_and_yarn-826852524d
dependabot/npm_and_yarn/npm_and_yarn-ab9a7f4bc2
deprecate-totp-2fa
dhei/classic-tokens
gat-bypass-2fa-docs
jpg619/fix-accessibility-content-flow
jpg619/version-bump-tar-2
kartykp/gat-bypass-2fa-docs
kartykp/upgrade-path-to-regex
main
maitxn/version-bump-tar
patch-1
reggi/cache-based-on-version
reggi/dev-engines
reggi/fix-transform-prettier
reggi/overrides
update-search-sensitivity
| 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/v10/cli-commands/deprecate |
| 18 | - /cli-documentation/v10/cli-commands/npm-deprecate |
| 19 | - /cli-documentation/v10/commands/deprecate |
| 20 | - /cli-documentation/v10/commands/npm-deprecate |
| 21 | - /cli-documentation/v10/deprecate |
| 22 | - /cli-documentation/v10/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/v10/cli-commands/deprecate |
| 30 | - /cli/v10/cli-commands/npm-deprecate |
| 31 | - /cli/v10/commands/deprecate |
| 32 | - /cli/v10/deprecate |
| 33 | - /cli/v10/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 | ### See Also |
| 87 | |
| 88 | - [package spec](/cli/v10/using-npm/package-spec) |
| 89 | - [npm publish](/cli/v10/commands/npm-publish) |
| 90 | - [npm registry](/cli/v10/using-npm/registry) |
| 91 | - [npm owner](/cli/v10/commands/npm-owner) |
| 92 | - [npm adduser](/cli/v10/commands/npm-adduser) |