今天有同學(xué)反饋在安裝composer后,在創(chuàng)建項(xiàng)目的時(shí)候出現(xiàn)了Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos錯(cuò)誤,其實(shí)這個(gè)辦法很簡(jiǎn)單,仔細(xì)看報(bào)錯(cuò)就知道,大概意思就是github的ssh密匙認(rèn)證錯(cuò)誤,需要去github上生成對(duì)應(yīng)的秘鑰文件,地址為:https://github.com/settings/tokens/new?scopes=&description=Composer+on+JSSM-20231021MK+2024-01-17+0948替換C:/Users/Administrator/AppData/Roaming/Composer/auth.json中的內(nèi)容即可。
根據(jù)提示重新生成token,然后放到auth.json文件里(文件須有寫入的權(quán)限)
"github-oauth": {
"github.com": "這里填token"},
保存就可以了。
也可以用第二種方法:composer config --global --auth github-oauth.github.com token系列號(hào)
You can also add it manually later by using "composer config --global --auth github-oauth.github.com <token>"
看看auth.json文件是不是變了
再看看composer安裝是不是已經(jīng)可以了