npm登录login时报错:npm ERR! code E401,npm ERR! Incorrect or missing password.

想要在npm上发布自己的组件库,npm登录login时报错:npm ERR! code E401,npm ERR! Incorrect or missing password.

PS D:\Workspace\WebstormProjects\lhqm-ngzorro>  npm login
Username: qianmian
Password:
Email: (this IS public) 2515114873@qq.com
npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at:
npm ERR!     https://www.npmjs.com/forgot
npm ERR!
npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR!     npm login

npm ERR! A complete log of this run can be found in:
npm ERR!     F:\Program_Files\QianDuan\nodejs\node_cache\_logs\2021-04-04T14_44_24_023Z-debug.log

在这里插入图片描述
这是因为之前npm使用了淘宝镜像,淘宝镜像只支持下载,不支持上传发布,需要将配置的registry重新指向npm官方registryhttps://registry.npmjs.org/:

npm config set registry https://registry.npmjs.org/

登录成功:

Logged in as qianmian on https://registry.npmjs.org/.

但是npm官方下载包很慢,再切换到淘宝镜像:

npm config set registry https://registry.npm.taobao.org 
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值