dependabot/npm_and_yarn/main/copy-to-clipboard-4.0.2
@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: release/v8 |
| 7 | github_path: docs/lib/content/commands/npm-deprecate.md |
| 8 | redirect_from: |
| 9 | - /cli-documentation/v8/cli-commands/deprecate |
| 10 | - /cli-documentation/v8/cli-commands/npm-deprecate |
| 11 | - /cli-documentation/v8/commands/deprecate |
| 12 | - /cli-documentation/v8/commands/npm-deprecate |
| 13 | - /cli-documentation/v8/deprecate |
| 14 | - /cli-documentation/v8/npm-deprecate |
| 15 | - /cli/v8/cli-commands/deprecate |
| 16 | - /cli/v8/cli-commands/npm-deprecate |
| 17 | - /cli/v8/commands/deprecate |
| 18 | - /cli/v8/deprecate |
| 19 | - /cli/v8/npm-deprecate |
| 20 | --- |
| 21 | |
| 22 | ### Synopsis |
| 23 | |
| 24 | ```bash |
| 25 | npm deprecate <package-spec> <message> |
| 26 | ``` |
| 27 | |
| 28 | Note: This command is unaware of workspaces. |
| 29 | |
| 30 | ### Description |
| 31 | |
| 32 | This command will update the npm registry entry for a package, providing a deprecation warning to all who attempt to install it. |
| 33 | |
| 34 | It works on [version ranges](https://semver.npmjs.com/) as well as specific versions, so you can do something like this: |
| 35 | |
| 36 | ```bash |
| 37 | npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3" |
| 38 | ``` |
| 39 | |
| 40 | SemVer ranges passed to this command are interpreted such that they _do_ include prerelease versions. For example: |
| 41 | |
| 42 | ```bash |
| 43 | npm deprecate my-thing@1.x "1.x is no longer supported" |
| 44 | ``` |
| 45 | |
| 46 | In this case, a version `my-thing@1.0.0-beta.0` will also be deprecated. |
| 47 | |
| 48 | You must be the package owner to deprecate something. See the `owner` and `adduser` help topics. |
| 49 | |
| 50 | 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. |
| 51 | |
| 52 | ### Configuration |
| 53 | |
| 54 | #### `registry` |
| 55 | |
| 56 | - Default: "https://registry.npmjs.org/" |
| 57 | - Type: URL |
| 58 | |
| 59 | The base URL of the npm registry. |
| 60 | |
| 61 | #### `otp` |
| 62 | |
| 63 | - Default: null |
| 64 | - Type: null or String |
| 65 | |
| 66 | This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with `npm access`. |
| 67 | |
| 68 | 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. |
| 69 | |
| 70 | ### See Also |
| 71 | |
| 72 | - [package spec](/cli/v8/using-npm/package-spec) |
| 73 | - [npm publish](/cli/v8/commands/npm-publish) |
| 74 | - [npm registry](/cli/v8/using-npm/registry) |
| 75 | - [npm owner](/cli/v8/commands/npm-owner) |
| 76 | - [npm adduser](/cli/v8/commands/npm-adduser) |