前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >composer错误提示Cloning failed using an ssh key for authentication的解决方法

composer错误提示Cloning failed using an ssh key for authentication的解决方法

作者头像
ytkah
发布2018-08-01 10:59:22
2.8K0
发布2018-08-01 10:59:22
举报
文章被收录于专栏:ytkahytkah

  早上ytkah在测试laravel用composer安装一些插件时出现了一些错误,提示如下,是github的ssh密匙认证错误,提示要重新生成token,然后保存在/root/.config/composer/auth.json文件中

代码语言:javascript
复制
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生成
github ssh key token生成

  然后放到auth.json文件里(文件须有写入的权限)

代码语言:javascript
复制
    "github-oauth": {
        "github.com": "这里填token"},

  保存就可以了。

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

代码语言:javascript
复制
You can also add it manually later by using "composer config --global --auth github-oauth.github.com <token>"

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

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

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018-07-08 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档