1

On npm publish following error is thrown. Had worked before.

npm ERR! code E404
npm ERR! 404 Not Found - PUT https://registry.npmjs.org/@XYZ - Not found
npm ERR! 404
npm ERR! 404  '@XYZ@5.0.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs\2021-11-11T06_46_42_252Z-debug.log
MemZ
  • 306
  • 4
  • 10

3 Answers3

2

Run the npm login command

E:\XYZ>npm login
Username: XXXXX
Password:
Email: (this IS public) myemail id
Logged in as XXXXXon https://registry.npmjs.org/.

and then publish again

MemZ
  • 306
  • 4
  • 10
1

I solve this issue by changing the registry from https://registry.npmjs.org to https://registry.npmjs.org/, there is an extra slash at the end of the line.

inoutwhy
  • 624
  • 1
  • 6
  • 12
1

In my case, after checking that I'm logged in by npm whoami I needed to be added to the organization that own the repo I wanted to publish the packaged for.

mpro
  • 14,302
  • 5
  • 28
  • 43