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 unpublish fails if scope is involved #5685

Closed
2 tasks done
JoFrMueller opened this issue Oct 12, 2022 · 2 comments · Fixed by #6082
Closed
2 tasks done

[BUG] npm unpublish fails if scope is involved #5685

JoFrMueller opened this issue Oct 12, 2022 · 2 comments · Fixed by #6082
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 8.x work is associated with a specific npm 8 release

Comments

@JoFrMueller
Copy link

JoFrMueller commented Oct 12, 2022

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

The following command fails if .npmrc contains @someScope:registry=https://some.npm.registry/

npm unpublish @someScope/somePackage@0.1.2-beta3

The command works though if .npmrc contains registry=https://some.npm.registry/

The weird thing is npm publish for the same package works if .npmrc contains @someScope:registry=https://some.npm.registry/

Expected Behavior

The npm unpublish command should work like the npm publish command if package scope is defined.

Steps To Reproduce

  1. In any NPM 8.19.2 environment with NodeJS 16.17.1 on Windows 11
  2. With some custom package and custom registry that is not https://registry.npmjs.org with .npmrc containing @someScope:registry=https://some.npm.registry/
  3. Run npm unpublish @someScope/somePackage@0.1.2-beta3
  4. See the following error:

npm ERR! 404 Not Found - GET https://registry.npmjs.org/@someScope%2fsomePackage - Not found
npm ERR! 404
npm ERR! 404 '@someScope/somePackage' is not in this registry.

This is correct, though the package clearly is in the custom registry. And switching from @someScope:registry=https://some.npm.registry/ to registry=https://some.npm.registry/ makes unpublish work again.

Environment

  • npm: 8.19.2
  • Node.js: 16.17.1
  • OS Name: Windows 11
  • System Model Name: Irrelevant
  • npm config:
@someScope:registry = "https://some.npm.registry/"
//some.npm.registry/:_authToken = (protected)
@JoFrMueller JoFrMueller added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Oct 12, 2022
@marcelo-michels
Copy link

Same problem here

  • npm: 8.19.2
  • Node.js: 18.11.0
  • OS Name: Mac OS
  • .npmrc
@my-org:registry=https://npm.pkg.github.com/my-org

@fritzy fritzy added Priority 1 high priority issue and removed Needs Triage needs review for next steps labels Oct 18, 2022
@jkupcho
Copy link

jkupcho commented Nov 3, 2022

It appears that this bug started in npm version 8.3.1.

Release:
https://github.com/npm/cli/releases/tag/v8.3.1
Code surrounding unpublish specifically:
2ac540b

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 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants