Search code examples
phpgitgithubcomposer-phpphpstorm

Composer install \ update authentication errors


When I'm trying to install dependency from my private repository and I'm getting the following error:

> /opt/lampp/bin/php /home/arthur/Sites/audio-video-caption.com/composer.phar install
Loading composer repositories with package information
Failed to clone the [email protected]:Djevil83/UserBundle.git repository, try running in interactive mode so that you can enter your GitHub credentials


  [RuntimeException]                                                                                                                                        
  Failed to execute git clone --mirror '[email protected]:Djevil83/UserBundle.git' '/home/arthur/.cache/composer/vcs/git-github.com-Djevil83-UserBundle.git/'  


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...


Process finished with exit code 1 at 15:40:11.
Execution time: 1 874 ms.

`

Here is my composer.json :

"repositories": [
    {
        "type": "vcs",
        "url": "[email protected]:Djevil83/UserBundle.git"
    },
]

I'm using Debian 8 and Xampp with php 7.

I don't know where is the error... thanks for your help !


Solution

  • First, confirm you setup access to the repo: https://help.github.com/articles/adding-collaborators-to-a-personal-repository/ so you can clone it using your private key. The command:

    git clone [email protected]:Djevil83/UserBundle.git
    

    should create a new directory UserBundle without asking password.

    Then read https://getcomposer.org/doc/articles/troubleshooting.md#api-rate-limit-and-oauth-tokens how to setup OAuth token to increase rate limit.