npm / registry-issue-archive

An archive of the old npm registry issue tracker
https://npm.community
249 stars 47 forks source link

`npm deprecate` not working #313

Closed jamesplease closed 6 years ago

jamesplease commented 6 years ago

Note: This issue was copied over from https://github.com/npm/npm/issues/20394

I'm opening this issue because:

What's going wrong?

The docs for deprecating a package give an example:

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

This is not working for me. I had to use this syntax:

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

(note the space that was removed).

This specific problem may be a docs update, so I opened an issue about that here. But the reason I am opening an issue here as well is because the deprecation didn't seem to work as expected. Here is what I ran:

npm deprecate react-request@"<2.0.4" "There is an important bug fix around caching in >= 2.0.4. Please upgrade."

I did not get an error, but installing 2.0.3 returns this message:

James’s:stuffy-stuff jmeas$ npm i react-request@2.0.3 --save
npm WARN deprecated react-request@2.0.3: There

It is like the deprecation message was cut off after the first word. Weird.

I tried to update it, but now I am getting:

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

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jmeas/.npm/_logs/2018-04-20T17_44_52_569Z-debug.log

I am not trying to un-deprecate the older versions, as users can't read the whole message, and I am getting:

npm deprecate react-request@"<2.0.4" ""
npm ERR! Usage: npm deprecate <pkg>[@<version>] <message>

I tried a number of variations, including:

npm deprecate react-request@2.0.3 ''
npm deprecate react-request@2.0.3 ""
npm deprecate react-request@"2.0.3" ""

I think something is broken here 😅

Most immediately, I would really appreciate it if someone at npm could either fix the deprecation warning for this package or remove it entirely. Users may be confused that the entire package is deprecated, and that would not be any good! Thank you!

Can someone at npm please remove the deprecation warning for this package? I don't want users to be confused by this!

How can the CLI team reproduce the problem?

Try and deprecate a package using that syntax. I tried this:

npm deprecate react-request@"< 2.0.4" "There is an important bug fix around caching in >= 2.0.4. Please upgrade."

And I get this error:

npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "<": Tags may not have any characters that encodeURIComponent encodes.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jmeas/.npm/_logs/2018-04-20T17_29_28_655Z-debug.log

Correct the syntax, and deprecate the package. Then, install an older version. See if the message is cut off. Even if it is not, try and deprecate it with a different message.

supporting information:


Thank you for reading!

jamesplease commented 6 years ago

Just tried running the command again. It seems resolved. Thanks!