Getting 404 when attempting to publish new package to NPM
Solution 1
You need to have registered "supericium" (npm adduser
) as a username at the registry and be logged in (npm login
) to publish under that scope.
- https://docs.npmjs.com/getting-started/publishing-npm-packages
- https://docs.npmjs.com/getting-started/scoped-packages
Solution 2
It's solved by npm login
in my case, the error message is misleading
Solution 3
Came across this same error, and my issue was that the package was somehow set to "Read" access only. So I have to go to the NPM and update the package to "Read/Write" access:
1.
2.
Solution 4
Nothing worked for me, except logging in again:
npm login
Hope this helps me or someone else in the future!
Solution 5
You could also get this error when you change your password to NPM but you do not logout/login via your CLI. Using npm logout
and then npm login
worked for me.
Related videos on Youtube
Ole
Updated on February 03, 2022Comments
-
Ole over 2 years
I just created a new package.
I'm now trying to publish it to NPM for the first time like this:
ole@MKI:~/Sandbox/pli$ npm publish --access public npm ERR! publish Failed PUT 404 npm ERR! Linux 3.13.0-93-generic npm ERR! argv "/home/ole/.nvm/versions/v6.4.0/bin/node" "/home/ole/.nvm/versions/v6.4.0/bin/npm" "publish" "--access" "public" npm ERR! node v6.4.0 npm ERR! npm v3.10.3 npm ERR! code E404 npm ERR! 404 Not found : @supericium/pli npm ERR! 404 npm ERR! 404 '@supericium/pli' 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! Please include the following file with any support request: npm ERR! /home/ole/Sandbox/pli/npm-debug.log
I tried updating both NodeJS and NPM to make sure that I have the latest version, which are:
ole@MKI:~/Sandbox/pli$ node --version v6.4.0 ole@MKI:~/Sandbox/pli$ npm --version 3.10.3
Thoughts?
-
Steve over 2 yearsYes, it makes no sense. Can't create a package because it doesn't exist. None of these answers solve the problem.
-
Oleg Valter is with Ukraine over 2 years@Distortum Try running
publish
in verbose mode - in a very frustrating way, in normal mode many issues end up as 404 while the real reason may be 403 because of a variety of issues. Usually running the verbose mode makes the issue apparent.
-
-
Jacob Poul Richardt about 5 yearsSpent so much time trying to fix it before I found this. Thanks ;)
-
Will Strohl almost 4 yearsUgh... This was it for me. There is nothing telling you you're not logged in.
-
DenisKolodin over 3 yearsIt works... but when I published my package to npm their website stopped to work and shows me
error loading page
:))) -
AndyO about 3 yearsSidenote: The problem isn't the client but that the npm registry sends 404. I've been told that when you e.g. use verdaccio as a proxy, it sends 401 if the login info is incorrect. Which makes the client show the expected "you need to log in" message.
-
Derek Hubbard about 3 yearsHow did you verify the email address? By executing
npm config ls
or something different? -
jthegedus almost 3 yearsThe default in the docs lists
.org
as the correct URL - docs.npmjs.com/cli/v7/using-npm/config#registry -
Steve over 2 yearsIt doesn't work.
-
dearwish over 2 yearsIt worked, thank you
-
Ben Racicot over 2 yearsWhoa! This was the answer for me. Despite being authenticated via command line I had to re-add my user and retry the publish. Really bad CLI experience on that one.
-
Conaclos over 2 yearsNPM error messages are still confusing... Thanks for the hint, it solved my problem :)