美文网首页
Git 代理 和 npm error code 128

Git 代理 和 npm error code 128

作者: ZHDelete | 来源:发表于2022-03-30 12:01 被阅读0次

设置 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 报错

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

使用下面的命令,达到,把地址里的 ssh://git@ 换成 https:// 的目的
git config --global url."https://".insteadOf ssh://git@
这个是 备选的写法 没试过
git config --global url."https://".insteadOf git://

但是,以ssh://git@github.com/nhn/raphael.git为例,你在浏览器 地址栏 直接输入https://git@github.com/nhn/raphael.git 也会重定向到https://github.com/nhn/raphael.git,因此,猜测,上面两个写法,都行

相关文章

网友评论

      本文标题:Git 代理 和 npm error code 128

      本文链接:https://www.haomeiwen.com/subject/zcwijrtx.html