npm ERR! code E401 npm ERR! Incorrect or missing password.
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! D:\npm-cache\_logs\2022-06-03T02_49_17_045Z-debug-0.log
这是因为之前npm使用了淘宝镜像,淘宝镜像只支持下载,不支持上传发布,需要将配置的registry重新指向npm官方registryhttps://registry.npmjs.org/,然后登陆:
npm config set registry https://registry.npmjs.org/
npm login
登录成功:
Logged in as xxxx on https://registry.npmjs.org/.
但是npm官方下载包很慢,再切换到淘宝镜像:
npm config set registry https://registry.npm.taobao.org
# 或者
npm config set registry https://registry.npmmirror.com
npm ERR! code E401 npm ERR! 401 Unauthorized - PUT npm.pkg.github.com/
运行:npm login --registry=https://npm.pkg.github.com 报错
npm ERR! code E401
npm ERR! 401 Unauthorized - PUT https://npm.pkg.github.com/-/user/org.couchdb.user:buyili - Error authenticating user: unable to authenticate actor: twirp error unauthenticated: User cannot be authenticated with the token provided.
这里给出了解决方案:stackoverflow.com/questions/5… 可能是github开启了二次验证,需要创建personal access token ,使用token登陆
登陆成功后