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

[Feature] Better error messages on npm publish failed #1408

Closed
2 tasks
thewrath opened this issue May 26, 2020 · 2 comments
Closed
2 tasks

[Feature] Better error messages on npm publish failed #1408

thewrath opened this issue May 26, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@thewrath
Copy link

  • I'd be willing to implement this feature
  • This feature can already be implemented through a plugin

Describe the user story

I wanted to publish a package on npm via yarn npm publish and I got the error:

YN0041: Invalid authentification (as undefined)

Actually it's because I haven't changed the version of my package... a better message saves time:

YN0041: Invalid version number

This request is not very important but would bring a better user experience. 🙂
Thank you for the work you're doing.

@thewrath thewrath added the enhancement New feature or request label May 26, 2020
@arcanis
Copy link
Member

arcanis commented May 26, 2020

Interesting - we throw this error when the npm registry returns HTTP 401 or 403 (Forbidden / Unauthorized). The undefined is whatever a subsequent call to the /-/whoami returns (your token username, usually).

I'm not sure we can do better, unless you can log the exact return from the API (you can do that by running yarn set version from sources --no-minify then adding console.log statement in the httpUtils module; would be nice to make a switch making that easier).

@arcanis
Copy link
Member

arcanis commented Jun 4, 2020

Closing for now; feel free to reopen with the extra information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants