繁体   English   中英

无法登录 GitHub Package 注册表

[英]Unable to login to GitHub Package Registry

I am trying to release npm package through GitHub Package Registry, I am following the documentation, When I try to login using the below command after entering the username and password (even though both are correct), I am getting below error always.

// Step 2: Authenticate
$ npm login --registry=https://npm.pkg.github.com/

错误日志:

npm login --registry=https://npm.pkg.github.com/
Username: ***********
Password:
Email: (this IS public) *****************
npm ERR! code E401
npm ERR! Registry returned 401 for PUT on https://npm.pkg.github.com/-/user/org.couchdb.user:kgangadhar: Error authenticating user: Bad credentials

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\karth\AppData\Roaming\npm-cache\_logs\2019-10-31T05_35_05_829Z-debug.log

有谁知道如何解决它?

您的 GitHub 帐户是否启用了 2 因素身份验证? 如果是这样,请尝试创建个人访问令牌并使用它而不是密码。 以下是创建令牌的说明

我遇到了同样的问题,因为我试图使用我的 Github 密码登录,而实际上您需要使用Github 个人访问令牌作为密码

Username: YOUR_GITHUB_USERNAME  
Password: YOUR_GITHUB_PERSONAL_ACCESS_TOKEN  
Email: YOUR_EMAIL

在本文中引用了您正在执行的相同命令,并且前面的答案是正确的。 只是留在这里以加强它:

链接到 Github 配置页面

只需Ctrl + F搜索npm login --registry=https://npm.pkg.github.com

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM