首页 > 小明同学 > ThinkPHP

Cloning failed using an ssh key for authentication

发布时间 :2021-03-06 | 编辑 :小明 | 阅读量 :1778

早上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 reposHead to https://github.com/settings/tokens/new?scopes=repodescription=Composer+on+服务器名称+2018-07-08+0803to 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=repodescription=Composer+on+服务器名称+2018-07-08+0803
& & 这个地址重新生成一下token,点击regenerate,复制生成的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

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

再看看composer安装是不是已经可以了

关注公众号
关注微信
购物车
回到顶部