Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm undeprecate still not working #3838

Closed
1 task done
globules-io opened this issue Oct 5, 2021 · 3 comments
Closed
1 task done

[BUG] npm undeprecate still not working #3838

globules-io opened this issue Oct 5, 2021 · 3 comments
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@globules-io
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

npm ERR! code E400
npm ERR! 400 Bad Request - PUT https://registry.npmjs.org/@globules-io%2fogx.js - deprecations must be strings

28 verbose stack HttpErrorGeneral: 400 Bad Request - PUT https://registry.npmjs.org/@globules-io%2fogx.js - deprecations must be strings

Expected Behavior

undeprecate a package

Steps To Reproduce

npm deprecate @globules-io/ogx.js@1.8.6 ""

Environment

  • OS: Windows 10 x64
  • Node: 16.10.0
  • npm: 7.24.2
@globules-io globules-io added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Oct 5, 2021
@sandersn
Copy link
Contributor

I'm not sure I have exactly the same problem, but I temporarily edited deprecate.js to remove the msg check at the start of deprecate:

async deprecate([pkg, msg]) {
  if (!pkg) //    <---- this used to read `if (!pkg || !msg)`

But this means if you forget the message it will always undeprecate, which doesn't seem right. The correct fix is probably to have a separate flag or a special message that causes undeprecation, since "" is ambiguous with not passing the flag at all, apparently.

@globules-io
Copy link
Author

globules-io commented Oct 26, 2021

I totally agree, undeprecate should be its own command, or maybe even something more eloquant such as restore

@wraithgar wraithgar added Priority 1 high priority issue and removed Needs Triage needs review for next steps labels Mar 17, 2022
@wraithgar wraithgar self-assigned this Apr 14, 2022
@wraithgar
Copy link
Member

wraithgar commented Apr 14, 2022

This appears to have been fixed since this issue was created. There was a PR that fixed the regression here: #3484.

I was able to deprecate and un-deprecate two test packages, one with only one version and one with multiple versions.

undeprecate would be a handy command to have, and that is in our backlog of things to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

3 participants