根据文档,全新安装laravel/homestead
流浪者框,运行init.sh
,配置Homestead.yaml
并运行$ vagrant up; vagrant ssh
。之后cd
已编辑到项目的文件夹并运行composer install
。
它挂起等待token
并带有以下消息
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
,我从来没有做过这些,这是一些未记录的新功能或错误,还是我做错了什么?
答案 0 :(得分:31)
如果您还没有GitHub帐户,则需要创建一个GitHub帐户,然后按照here说明操作,然后复制该令牌。
获得令牌后,再次运行composer install,然后在提示时将其粘贴到其中。
答案 1 :(得分:2)
错误表示您已超出IP地址的API速率限制。
你可以:
按照消息的建议指定您的身份验证令牌:
请创建一个GitHub OAuth令牌来检查API速率限制 前往https://github.com/settings/tokens/new?scopes=repo
并传入您的Composer命令或手动将其添加到~/.composer/auth.json
,例如
{
"http-basic": {},
"github-oauth": {
"github.com": "__TOKEN__"}
}
注意:在Windows上,它位于%APPDATA%/Composer
。
或通过以下命令手动添加设置(根据此comment):
composer config -g --unset github-oauth.api.github.com
composer config -g github-oauth.github.com __TOKEN__
答案 2 :(得分:0)