一、须要修改地址,通常为了下载速度快会改成npm config set registry https://registry.npm.taobao.org,但发布npm包时必须为npm的地址:npm config set registry http://registry.npmjs.org/
npm ERR! code E403
npm ERR! 403 Forbidden - PUT https://registry.npm.taobao.org/vue-short-cut - [no_perms] Private mode enable, only admin can publish this module复制代码
二、包重名,修改package.json中的name
npm ERR! publish Failed PUT 403
npm ERR! code E403
npm ERR! You do not have permission to publish "vue-short-cut". Are you logged inas the correct user?
复制代码
npm ERR! code E403
npm ERR! 403 Forbidden - PUT http://registry.npmjs.org/vue-short-cut - Package name too similar to existing packages; try renaming your package to '@logmei/vue-short-cut' and publishing with 'npm publish --access=public' instead复制代码
四、版本不容许重复,须要修改package.json中的version
npm ERR! code E403
npm ERR! 403 Forbidden - PUT http://registry.npmjs.org/@logmei%2fvue-short-cut - You cannot publish over the previously published versions: 0.1.2.复制代码
根据规范,只有在发包的24小时内才容许撤销发布的包( unpublish is only allowed with versions published in the last 24 hours); 即便你撤销了发布的包,发包的时候也不能再和被撤销的包的名称和版本重复了(即不能名称相同,版本相同,由于这二者构成的惟一标识已经被“占用”了)