Git 代理 和 npm error code 128

設(shè)置 git 代理

端口自行更改, 這里以clash為例

git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy https://127.0.0.1:7890

清空 git 代理

git config --global --unset http.proxy

git config --global --unset https.proxy

npm 清空緩存

npm config delete proxy

npm 刪除代理

npm config delete proxy

npm128 報(bào)錯(cuò)

npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/adobe-webplatform/eve.git
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\Develo\nodejs\node_cache\_logs\2022-02-23T03_34_18_949Z-debug-0.log

使用下面的命令,達(dá)到,把地址里的 ssh://git@ 換成 https:// 的目的
git config --global url."https://".insteadOf ssh://git@
這個(gè)是 備選的寫法 沒(méi)試過(guò)
git config --global url."https://".insteadOf git://

但是,以ssh://git@github.com/nhn/raphael.git為例,你在瀏覽器 地址欄 直接輸入https://git@github.com/nhn/raphael.git 也會(huì)重定向到https://github.com/nhn/raphael.git,因此,猜測(cè),上面兩個(gè)寫法,都行

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容