composer錯誤提示Cloning failed using an ssh key for authentication的解決方法

  早上ytkah在測試laravel用composer安裝一些插件時出現了一些錯誤,提示以下,是github的ssh密匙認證錯誤,提示要從新生成token,而後保存在/root/.config/composer/auth.json文件中laravel

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+服務器名稱+2018-07-08+0803
to retrieve a token. It will be stored in "/root/.config/composer/auth.json" for future use by Composer.

  首先到https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+服務器名稱+2018-07-08+0803這個地址從新生成一下token,點擊regenerate,複製生成的tokengit

github ssh key token生成

  而後放到auth.json文件裏(文件須有寫入的權限)github

"github-oauth": {
        "github.com": "這裏填token"},

  保存就能夠了。json

  也能夠用第二種方法:composer config --global --auth github-oauth.github.com token系列號bash

You can also add it manually later by using "composer config --global --auth github-oauth.github.com <token>"

  看看auth.json文件是否是變了服務器

  再看看composer安裝是否是已經能夠了composer

相關文章
相關標籤/搜索