Getting 404 when attempting to publish new package to NPM

心已入冬 提交于 2019-12-05 07:43:12

You need to have registered "supericium" (npm adduser) as a username at the registry and be logged in to publish under that scope.

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.

in my case i noticed that my npm account username in npm website is different than my npm normal user name. When i try to publish in console by login with normal username gave me this error.

publish Failed PUT 404 npm ERR! code E404 npm ERR! 404 User not found

But after login to console with account name it has published successfully

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'.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!