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
.
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):
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?
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.
Once you've got your token, run composer install again and then paste the token in when it prompts you for it.
The error means that you have exceeded the API rate limit for your IP address.
You can either:
- wait a bit and re-try again,
- change your IP address (e.g. by connecting via proxy or VPN),
specify your authentication token as suggested by the message:
Please create a GitHub OAuth token to go over the API rate limit
Head to https://github.com/settings/tokens/new?scopes=repo
and pass into your Composer command or add it manually into ~/.composer/auth.json
, e.g.
{
"http-basic": {},
"github-oauth": {
"github.com": "__TOKEN__"}
}
Note: On Windows, it's in %APPDATA%/Composer
.
or add the settings manually by the following commands (as per this comment):
composer config -g --unset github-oauth.api.github.com
composer config -g github-oauth.github.com __TOKEN__
Go to settings then Developer settings from personal access token you can generate a new token