node.js - 无法登录 GitHub 包注册表
问题描述
我正在尝试通过 GitHub 包注册表发布 npm 包,我正在关注文档,当我在输入username
and后尝试使用以下命令登录时password
(即使两者都是正确的),我总是遇到错误。
// 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 因素身份验证?如果是这样,请尝试创建个人访问令牌并使用它而不是密码。以下是创建令牌的说明。
推荐阅读
- java - 标签的 JavaFx setText
- css - 基于容器宽度的CSS变换比例
- angular - Angular 5 上的 LINE 共享插件
- sql-server - 如何停止显示“进行中”状态的 SQL 作业?
- mysql - 限制对计数无效?mysql
- google-bigquery - 使用 Appengine 将数据流式传输到 Bigquery
- maven - 由于连接重置错误,AWS 中的 Maven 工件传输失败
- java - 在构造函数中创建 XML
- mysql - 显示在 1981 年头两个月雇用至少两名商业乘客的 OOUR 的名称和城镇
- eloquent - 使用 laravel 和 Eloquent 对表和数据透视表进行级联更新