GitHub API rate limit when using composer during installation
In the last two dependencies composer stops and waits for a GitHub token. Not a blocker, since just pressing enter it continues, but can this be circumvented somehow? Thanks :)
- Installing rcrowe/twigbridge (v0.9.0)
Downloading: Connecting...
Could not fetch https://api.github.com/repos/rcrowe/TwigBridge/zipball/f875fa9457ebadf8f24b683b226848b660407f8f, 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+debian-jessie+2015-12-13+2220
to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer.
Token (hidden):
No token given, aborting.
You can also add it manually later by using "composer config github-oauth.github.com <token>"
Failed to download rcrowe/twigbridge from dist: Could not authenticate against github.com
Now trying to download from source
- Installing rcrowe/twigbridge (v0.9.0)
Cloning f875fa9457ebadf8f24b683b226848b660407f8f
- Installing roumen/feed (v2.9.7)
Downloading: Connecting...
Could not fetch https://api.github.com/repos/RoumenDamianoff/laravel-feed/zipball/4611e281e28934b17c564be8f709ac99176cf5f9, 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+debian-jessie+2015-12-13+2239
to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer.
Token (hidden):
No token given, aborting.
You can also add it manually later by using "composer config github-oauth.github.com <token>"
Failed to download roumen/feed from dist: Could not authenticate against github.com
Now trying to download from source
- Installing roumen/feed (v2.9.7)
Cloning 4611e281e28934b17c564be8f709ac99176cf5f9
Yes. The thing you've pasted there actually has instructions for you. ;)
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+debian-jessie+2015-12-13+2239 to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer.
Thanks I know that :p I was just wondering if there was a better way. I'm actually writing an article for DigitalOcean and I'm documenting all the details.
I think that's the best way. Well, doing that before you start is the best way. ;)
That's one of the thing's I'd recommend doing as part of the installation process of composer tbh.
So far, using composer install --prefer-source --no-interaction --no-dev -o seems to have no issues and bypasses the API as it fetches from source.
Thanks for your answers :) @ALinuxNinja that is interesting, didn't know about that. I see that there are two ways declared in composer.lock, source and dist, and reading the composer docs it now makes sense.
I'd still recommend NOT using --prefer-source, because using dist will give you a much smaller vendor folder due to no git clone, and also due to the fact that it only downloads the actual code, without the tests and the readmes and stuff.
@GrahamCampbell thanks for the clarification :)
:+1: on the not using --prefer-source if possible. People can also use their regular GitHub OAuth tokens with composer as well instead of making a new one. Can't wait for the article!
Ok got it, dist is the recommended one. I'll make sure the benefits are stressed out, thanks everyone!
So far, using
composer install --prefer-source --no-interaction --no-dev -oseems to have no issues and bypasses the API as it fetches from source.
That remove all my packages. Thank you. Next time I will think what im doing.
el proyecto debe tener un token generado como indicaron mas arriba. Ése debes pegarlo en la terminal cuando te lo pida el composer