1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

composerでgitの公開レポジトリからcloneする際のエラーの回避方法

Posted at

composerでgitの公開レポジトリから下記のようにしてパッケージをインストールしようとしたら

composer.json
...
    "repositories": [
        {
            "url": "git@github.com:pikanji/agent-plugin.git",
            "type": "git"
        }
    ]
}

認証がどうのでエラーになった。(Docker container内で実行したんで、Docker特有の問題かも。)

Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+9a20d36bf162+2017-11-19+0747
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 --global --auth github-oauth.github.com <token>"

  [RuntimeException]                                                                                                                                         
  Failed to execute git clone --mirror 'git@github.com:pikanji/agent-plugin.git' '/root/.composer/cache/vcs/git-github.com-pikanji-agent-plugin.git/' 

レポジトリ定義をhttpsに変更したら、あっさり解決した。

composer.json
...
    "repositories": [
        {
            "url": "https://github.com/pikanji/agent-plugin.git",
            "type": "git"
        }
    ]
}
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?