fresh laravel/homestead供应上GitHub OAuth令牌的编写器错误
新安装了一个fresh laravel/homestead供应上GitHub OAuth令牌的编写器错误,github,laravel-5,composer-php,homestead,Github,Laravel 5,Composer Php,Homestead,新安装了一个laravel/homestadvagrant箱,根据文档,运行init.sh,配置homestad.yaml并运行$vagrant up;流浪汉ssh。之后,将cd”放入项目文件夹并运行composer安装 它挂起等待带有以下消息的令牌 Loading composer repositories with package information Installing dependencies (including require-dev) from lock file - Inst
laravel/homestad
vagrant箱,根据文档,运行init.sh
,配置homestad.yaml
并运行$vagrant up;流浪汉ssh
。之后,将cd
”放入项目文件夹并运行composer安装
它挂起等待带有以下消息的令牌
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
,而且我从来没有做过任何这些,这是一些未记录的新功能还是一个bug,还是我做错了什么?如果你还没有GitHub帐户,你需要创建一个,然后按照说明复制令牌
获得令牌后,再次运行composer install,然后在提示您输入令牌时将其粘贴到中。此错误表示您已超过IP地址的API速率限制
您可以:
- 请稍等,然后再试一次
- 更改您的IP地址(例如通过代理或VPN连接)
- 按照消息建议指定您的身份验证令牌:
请创建GitHub OAuth令牌以超过API速率限制
直奔
并将其传递到Composer命令或手动添加到
~/.Composer/auth.json
,例如
{
"http-basic": {},
"github-oauth": {
"github.com": "__TOKEN__"}
}
注意:在Windows上,它位于中
或通过以下命令手动添加设置(根据此命令):
进入设置,然后从个人访问令牌进入开发者设置,您可以生成一个新令牌
这就解决了问题。我只是不明白为什么它突然要一个代币;比如,我已经使用Laravel一年了,从来没有人要求我提供令牌。如何在windows中的命令行中再次运行composer install?尽管您以前从未这样做过,但您突然不得不这样做的原因是您已经超过了Github API速率限制,目前为每小时60个请求。
composer config -g --unset github-oauth.api.github.com
composer config -g github-oauth.github.com __TOKEN__