新的 laravel/homestead 配置中的 GitHub OAuth 令牌的 Composer 错误令牌、错误、homestead、laravel

2023-09-06 16:50:51 作者:我也就玩玩而已i

Fresh 安装了一个 laravel/homestead vagrant box,按照文档,运行 init.sh,配置 Homestead.yaml 并运行 $ vagrant up;vagrant ssh.然后 cd'ed 到项目的文件夹并运行 composer install.

Fresh installed a laravel/homestead vagrant box, as per docs, run the init.sh, configured Homestead.yaml and ran $ vagrant up; vagrant ssh. Afterwards cd'ed to project's folder and ran composer install.

它挂起等待带有以下消息的 token

It hangs waiting for a token with the following message

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing sebastian/diff (1.3.0)
Downloading: Connecting...
Could not fetch https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3, please create a GitHub OAuth token to go over the API rate limit
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+homestead+2015-08-01+2140
to retrieve a token. It will be stored in "/home/vagrant/.composer/auth.json" for future use by Composer.
Token (hidden):

我以前使用过 laravel/homestead,但我从来没有做过这些,这是一些未记录的新功能还是错误,还是我做了什么错了吗?

I have used laravel/homestead before, and I have never had to do any of these, is this some undocumented new feature or a bug or did I do something wrong?

推荐答案

如果您还没有 GitHub 帐户,则需要创建一个,然后按照说明操作 这里 然后复制令牌.

You'll need to create a GitHub account if you don't already have one and then follow the instruction here and then copy the token.

获得令牌后,再次运行 composer install,然后在提示您输入令牌时将其粘贴.

Once you've got your token, run composer install again and then paste the token in when it prompts you for it.