When I run composer update
, I get the following error:
Could not fetch https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf, please review your configured GitHub OAuth token or enter a new one to access private repos. When working with public GitHub repositories only, head to https://github.com/settings/tokens/new?scopes=&description=Composer to retrieve a token.
Then I go to "https://github.com/settings/tokens/new", generate a new token and set it using the following command:
composer config --global github-oauth.github.com [token]
even after that, when I run composer update
I get the same error. How can I fix this?
You are missing --auth
in the command.
The command should be:
composer config --global --auth github-oauth.github.com [token]
I just had the same problem and it was due to incorrect credentials in my auth.json
file. Two suggestions:
auth.json
file as described in the docs:{
"http-basic": {
"example.org": {
"username": "username",
"password": "password"
}
},
"github-oauth": {
"github.com": "ghp_your_token_here"
}
}
auth.json
file.Hope that this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With