npm deprecate giving Error E422 Unprocessable Entity


(Emily Plummer) #1

Hey there!

I’m trying to deprecate my team’s package as we’ve renamed it. I’m running:

npm deprecate primer-react@"*" "primer-react has been renamed to @primer/components, please install the renamed package."

I’ve also tried:
npm deprecate primer-react@"< 2.0.3-beta" "primer-react has been renamed to @primer/components, please install the renamed package"

Here’s the error I’m getting:

npm ERR! code E422
npm ERR! Unprocessable Entity : primer-react

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/emplums/.npm/_logs/2018-09-21T22_35_10_731Z-debug.log

I’m on npm 6.4.1 and Node 10.1.0, I’ve also had a coworker try and he’s on npm 6.2.0 and Node 10.7.0

I thought maybe it was a permissions issue, but I doubled checked and both me & my coworker are owners of the package.

I’m pretty stumped! Would love to hear if anyone has any tips!


(CJ Joulain) #2

Hi @emplums!

We have a bug that prevents us from deprecating packages with dashes in their version numbers. As a workaround for this, you are welcome to deprecate your specified package if you publish a placeholder. Please note you must publish it as a major version; otherwise, the workaround will not go in effect.

Let me know if this helps.


(Emily Plummer) #3

Hey CJ!

When you say publish a placeholder do you mean publish the next major version with just a readme and package.json? Is there a way to still get the deprecate message to show up in the CLI when users install the package?


(CJ Joulain) #4

Hi @emplums. Exactly! By new placeholder, I meant a project with just a package.json and README file. After specifying version 3.0.0 in your package.json, you’d have to run the npm deprecate command again. This time (with the new major version indicated), we expect it to work. If not, let me know and I’ll dig in further.


(system) #5

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.