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

相关文章
相关标签/搜索