处理npm publish报错问题

上传项目到npm-->为社会做贡献

  1. 首先你得有一个项目
  2. npm init 生成package.json 来设置相信息
  3. 注册登录npm:npm adduser 输入你的一些信息
  4. 查看当前npm登录人 npm whoami
  5. npm publish
    出现问题:
192:react-native-native xieyusheng$ npm publish
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xieyusheng/.npm/_logs/2018-05-12T14_20_31_543Z-debug.log. 

解决:

您首先执行下 npm adduser ,输入您相应的 Username 、 Password 、 Email: (this IS public) ,关键的一步来了!

Logged in as 您的Username on https://registry.npmjs.org/.
如果 on 后面不是 https://registry.npmjs.org/ ,而是其他的镜像,比如我们大家常见的淘宝镜像:

http://registry.npm.taobao.org/
那么您首先替换成原来的,替换成原来执行如下命令:

npm config set registry https://registry.npmjs.org/
最后,替换完毕再执行 npm adduser 、 npm publish ,这样应该就ok了!

转载于:https://www.cnblogs.com/allenxieyusheng/p/9030222.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值