composer错误提示Cloning failed using an ssh key for authentication的解决方法
早上ytkah在测试laravel用composer安装一些插件时出现了一些错误,提示如下,是github的ssh密匙认证错误,提示要重新生成token,然后保存在/root/.config/composer/auth.json文件中
1 2 3 | 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
然后放到auth.json文件里(文件须有写入的权限)
1 2 | "github-oauth" : { "github.com" : "这里填token" }, |
保存就可以了。
也可以用第二种方法:composer config --global --auth github-oauth.github.com token系列号
1 | You can also add it manually later by using "composer config --global --auth github-oauth.github.com <token>" |
看看auth.json文件是不是变了
再看看composer安装是不是已经可以了

加微信交流
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
2016-07-08 Bootstrap速学教程之简要介绍
2016-07-08 微信上线朋友圈屏蔽提醒功能 还你刷的纯净感