I just created a new package: https://github.com/supericium/pli
I\'m now trying to publish it to NPM for the first time like this:
ole@MKI:~/Sand
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.
Once you successfully publish the package you may experience when you try to npm install
:
npm ERR! code E404
npm ERR! 404 Not Found: @xxx/yyy@latest
or something similar, regardless if you npm publish
was successful. In this case make sure your {main: 'file.js'}
in packages.json is there.
Ideally, you can call it index.js
if you wish to leech directly from the package so you don't get things like import * from '@xxx/yyy/file'
.
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.
in my case I had to verify the email address. even when npm whoami
was telling me I was logged in fine.
In my case, I was missing the repository
field in the package.json
of my new package that I was trying to publish.
"repository": "git://github.com/your-org/your-repo-name.git"
https://docs.npmjs.com/files/package.json#repository
You need to have registered "supericium" (npm adduser
) as a username at the registry and be logged in to publish under that scope.