Skip to content

Instantly share code, notes, and snippets.

@nmnp
Last active March 8, 2022 11:08
Show Gist options
  • Save nmnp/0d23e1026b54d6f5bc7caa740240a437 to your computer and use it in GitHub Desktop.
Save nmnp/0d23e1026b54d6f5bc7caa740240a437 to your computer and use it in GitHub Desktop.
Could not authenticate against github.com composer error

Could not authenticate against github.com

This could be related to GitHub rate limits being reached. Specify your GitHub API token to avoid it.

For example by the following command:

composer config --global github-oauth.github.com <TOKEN> or inside your composer.json file:

  "config": {
    "github-oauth": {
      "github.com": "<TOKEN>"
      }
    }
}```
See: [API rate limit and OAuth tokens](https://github.com/composer/composer/blob/master/doc/articles/troubleshooting.md#api-rate-limit-and-oauth-tokens) page and related [GH-3542 issue](https://github.com/composer/composer/issues/3542#issuecomment-67623002).

`Skipped installation of bin bin/X for package X/Y: name conflicts with an existing file`

If you believe that message causing any issues, check the current value of `bin-dir` by `composer config bin-dir` command. If it is incorrect, make sure to `unset COMPOSER_BIN_DIR` shell variable before running `composer` command, since it will override your `composer.json`'s `bin-dir`.
@connor11528
Copy link

@nmnp Where do we find our Github API token? Is this different from Personal Access Tokens? I have this config block set in my composer.json but still get the error, so I think my token might not be right :/

@alexwenzel
Copy link

@nmnp Where do we find our Github API token? Is this different from Personal Access Tokens? I have this config block set in my composer.json but still get the error, so I think my token might not be right :/

put it in a auth.json file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment