捆绑命令提示 GitHub 登录不起作用



当我运行捆绑包时,我得到这个:

$ bundle
Following files may not be writable, so sudo is needed:
/Library/Ruby/Gems/2.3.0
/Library/Ruby/Gems/2.3.0/build_info
/Library/Ruby/Gems/2.3.0/cache
/Library/Ruby/Gems/2.3.0/doc
/Library/Ruby/Gems/2.3.0/extensions
/Library/Ruby/Gems/2.3.0/gems
/Library/Ruby/Gems/2.3.0/specifications
Fetching https://github.com/lsegal/yard.git
Fetching https://github.com/lsegal/yard-js.git
Fetching https://github.com/lsegal/parsejs.git
Username for 'https://github.com': me
Password for 'https://me@github.com': 
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/lsegal/parsejs.git/'
Retrying `git clone 'https://github.com/lsegal/parsejs.git' "/Users/me/.bundle/cache/git/parsejs-35f0b5a29373e174672dd4f95a4392093a2ddf51" --bare --no-hardlinks --quiet` due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'https://github.com/lsegal/parsejs.git' "/Users/me/.bundle/cache/git/parsejs-35f0b5a29373e174672dd4f95a4392093a2ddf51" --bare --no-hardlinks --quiet` in directory /Users/paulcarron/git/ibm-cos-sdk-js has failed.
Username for 'https://github.com': me
Password for 'https://me@github.com': 
remote: Repository not found.
fatal: repository 'https://github.com/lsegal/parsejs.git/' not found
Retrying `git clone 'https://github.com/lsegal/parsejs.git' "/Users/me/.bundle/cache/git/parsejs-35f0b5a29373e174672dd4f95a4392093a2ddf51" --bare --no-hardlinks --quiet` due to error (3/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'https://github.com/lsegal/parsejs.git' "/Users/me/.bundle/cache/git/parsejs-35f0b5a29373e174672dd4f95a4392093a2ddf51" --bare --no-hardlinks --quiet` in directory /Users/paulcarron/git/ibm-cos-sdk-js has failed.
Username for 'https://github.com':

我使用相同的用户名通过浏览器登录了GitHub,所以不知道发生了什么。有人可以帮忙吗?

您需要创建一个 Github 令牌才能通过命令行 API 进行访问。转到Settings -> Developer Settings -> Access Tokens并创建新令牌。

我不完全确定你需要哪一套。我给了自己repo(全部(、write:packagesread:packagesworkflow,因为这就是我想要的。我的猜测是read:packages就足够了。

然后,您可以在捆绑包提示时提供您的常规 Github 用户名和此新令牌。

最新更新