Chr*_*sco 11 github composer-php laravel-5 homestead
全新安装了一个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):
Run Code Online (Sandbox Code Playgroud)
我以前用过laravel/homestead,我从来没有做过这些,这是一些无证的新功能还是一个bug或者我做错了什么?
该错误意味着您已超出 IP 地址的 API 速率限制。
您可以:
按照消息的建议指定您的身份验证令牌:
请创建一个 GitHub OAuth 令牌以超过 API 速率限制前往https://github.com/settings/tokens/new?scopes=repo
并传入您的 Composer 命令或将其手动添加到~/.composer/auth.json,例如
{
"http-basic": {},
"github-oauth": {
"github.com": "__TOKEN__"}
}
Run Code Online (Sandbox Code Playgroud)
注意:在 Windows 上,它位于%APPDATA%/Composer.
或通过以下命令手动添加设置(根据此评论):
composer config -g --unset github-oauth.api.github.com
composer config -g github-oauth.github.com __TOKEN__
Run Code Online (Sandbox Code Playgroud)