I am trying to publish the package using npm publish command. but I am getting this error every time.
npm ERR! code E403
npm ERR! 403 Forbidden - PUT https://registryname - forbidden
I have
"publishConfig": {
"registry": "https://registryname"
}
and in.npmrc
registry=https://registryname
I have tried many solutions but no luck.
Or anyone trying to publish a package (for the first time) and getting the same failure, it could also be because you just created npmjs account, and you haven't yet verified the account creation through a link that was sent to your email address.
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/mac-info-lib - you must verify your email before publishing a new package: https://www.npmjs.com/email-edit
Do you have an account? You can;
npm whoami
npm login
. Follow the login prompt.If your library has a name that is already existed in npm registry. It will give you this error.
npm ERR! code E403
npm ERR! 403 Forbidden - PUT https://registryname - forbidden
Solution:
package.json
fie.Be sure to login first to the official link: https://www.npmjs.com/login
then they will ask for mail verification(A kind of pop up at the header).
After verification npm publish will work.
Note: if still not working change package name
Or just go into your package.json and update the version
number.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.