NPM-DEPRECATE(1)

πŸ’… npm-deprecate(1) β€” the deprecation station

okay bestie, so this is the npm-deprecate girlie pop, and she lives in the npm manual. Her whole job? Slapping a "do not install this, queen, it's over" warning on a version of a package. Iconic, honestly.

✨ Synopsis ✨

npm deprecate <package-spec> <message>
heads up 🫢 this command is unaware of workspaces. Like, she does not see them, does not acknowledge them, they are not on her radar. periodt.

πŸŽ€ Description πŸŽ€

So what she does is update the npm registry entry for a package and attach a deprecation warning to it β€” which means literally everyone who tries to install it gets the little warning message. It's giving public service announcement energy πŸ’–

She works on version ranges (that's the whole semver situation over at https://semver.npmjs.com/, iykyk) and on specific versions, so you can absolutely do a little something like this:

npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3"

And here's the lil plot twist πŸ‘€ the SemVer ranges you pass in get interpreted so that they do include prerelease versions. Example time:

npm deprecate my-thing@1.x "1.x is no longer supported"

In that case a version like my-thing@1.0.0-beta.0 will also get deprecated. No prerelease escapes. she sees all πŸ’€

You must be the package owner to deprecate something β€” that's the vibe check, no cap. Check out the owner and login help topics if you need to sort that out.

Wanna un-deprecate a package? Bestie, that's easy β€” just specify an empty string ("") for the message argument. But lowkey important: you have to use double quotes with no space between them to format that empty string. "". that's it. that's the whole thing πŸ™ˆ

⭐ Configuration ⭐

🌈 registry

The base URL of the npm registry. That's it, that's the address of the whole party.

πŸ”₯ otp

  • Default: null
  • Type: null or String

This is a one-time password from a two-factor authenticator. She's needed when you're publishing or changing package permissions with npm access.

If you haven't set it, and a registry response comes back with a challenge asking for a one-time password, npm will prompt you for one right there on the command line. 🫢

πŸ¦‹ dry-run

  • Default: false
  • Type: Boolean

Tells npm you do not want it making any changes, and that it should only report what it would have done. Very "window shopping, not buying" of you ✨ 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.

⚠️ Note: this is NOT honored by other network related commands, eg dist-tags, owner, etc. So don't come for her when it doesn't work there πŸ’€

πŸ‘‘ See Also πŸ‘‘

  • npm help "package spec"
  • npm help publish
  • npm help registry
  • npm help owner
  • npm help login

okay that's the whole page, no crumbs left πŸ“ this was npm@12.2.1, from October 2026, and honestly? she ate. go deprecate something responsibly, bestie πŸ’œβœ¨

πŸ“¦ where this page comes from