git dep preparation failed 报错

这篇博客记录了在尝试安装npm包时遇到的错误,包括'npm ERR! code 128'和'git connection error occurred'。作者尝试了使用淘宝镜像cnpm、yarn以及升级git版本等方法,但问题仍未解决。最终,通过修改git配置为强制使用https协议成功安装了npm包。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

npm ERR! code 128
npm ERR! git dep preparation failed
npm ERR! command E:\node.exe C:\Users\92417\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js install --force --cache=C:\Users\92417\AppData\Local\npm-cache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 128
npm ERR! npm ERR! A git connection error occurred
npm ERR! npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/adobe-webplatform/eve.git
npm ERR! npm ERR! kex_exchange_identification: read: Connection reset by peer
npm ERR! npm ERR! Connection reset by 20.205.243.166 port 22
npm ERR! npm ERR! fatal: Could not read from remote repository.
npm ERR! npm ERR!
npm ERR! npm ERR! Please make sure you have the correct access rights
npm ERR! npm ERR! and the repository exists.
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! C:\Users\92417\AppData\Local\npm-cache_logs\2022-02-24T08_05_03_956Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\92417\AppData\Local\npm-cache_logs\2022-02-24T08_05_37_379Z-debug.log

在这里插入图片描述
试了淘宝镜像 cnpm yarn 都没用 升级了git版本 也没用
后来使用
git config --global url.“https://”.insteadOf git://
这个好像是强制使用https
然后npm i 好了

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值