报错:Cloning failed using an ssh key for authentication, enter your GitHub credentials to access priva

通过composer install 从github上下载依赖时报错:
Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
在这里插入图片描述
原因:
这个是github的ssh密匙认证错误,提示要重新生成token,然后保存在/root/.config/composer/auth.json文件中

解决:
根据提示,
when you need to access private GitHub repositories as well, go to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+localhost.localdomain+2022-04-07+0222
打开提示里面地址,来生成新的token
即:

https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+localhost.localdomain+2022-04-07+0222

点击regenerate,生成新token,复制生成的token
在这里插入图片描述

[root@localhost snipe-it]# vim /root/.config/composer/auth.json
{
    "bitbucket-oauth": {},
    "github-oauth": {"github.com":"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"},
    "gitlab-oauth": {},
    "gitlab-token": {},
    "http-basic": {},
    "bearer": {}
}

版权声明:本文为robin_cai原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。