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


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

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,復制生成的token

github ssh key token生成

  然后放到auth.json文件里(文件須有寫入的權限)

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

  保存就可以了。

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

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

  看看auth.json文件是不是變了

  再看看composer安裝是不是已經可以了

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM