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
- Default:
"https://registry.npmjs.org/" - Type: URL
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, egdist-tags,owner, etc. So don't come for her when it doesn't work there π
π See Also π
npm help "package spec"npm help publishnpm help registrynpm help ownernpm 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
- arch rolling: npm 12.2.1-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms