当前位置:网站首页>Common problems encountered when creating and publishing packages using NPM

Common problems encountered when creating and publishing packages using NPM

2022-06-25 23:57:00 wen_ Wen Wen

1.、npm publish Error when publishing package 403
 Insert picture description here
Log in to your npm account number , Check whether mailbox verification has been performed , If not verified , There will be a prompt at the top of the website ;
I didn't verify my email, so I will report an error , However, it is different from the detailed error reporting without email verification on the Internet , But the error codes are 403

2、 Delete the specified version :npm unpublish [email protected] Version number
 Insert picture description here
3、 Current npm The image is Taobao image :

Switch back to the original image source : npm config set registry https://registry.npmjs.org/
Set the image source to Taobao image :npm config set registry http://registry.npm.taobao.org/
 Insert picture description here

4.、 Modify your own npm After the package , If you want to republish :
npm version patch; // to update npm Published package version , Update local package.json Version number in ;
npm publish; // Publish your own npm package

5、 Delete the package and publish it again : There was a problem after the release ,npm unpublish Error occurs when publishing again after deletion ;
 Insert picture description here
Solution : 1. Modify package name
2. etc. 24 Hours later, the package with the same name will be released

6、npm publish Publishing times is wrong :403 Code ;
 Insert picture description here
Solution : package.json It's written in the document name Name and npm There is a duplicate name on the Internet , Need to change the name before publishing ;

原网站

版权声明
本文为[wen_ Wen Wen]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206252102465338.html