npm ERR code 128 npm ERR An unknown git error occurred npm ERR command git --no-replace-objects l

在尝试从GitHub克隆vue-element-admin并安装依赖时遇到了npm代码128和权限错误。问题根源在于SSH配置。通过将ssh链接替换为https,并修改.gitconfig文件,然后使用`npm install --registry=https://registry.npm.taobao.org`,成功解决报错。最后运行`npm run dev`启动项目,一切顺利。
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

在git上下载以来的vue-element-admin 安装依赖的时候报错。
以上这个报错是我最头疼的,弄了很久,网上查阅了各种文章,还是没有找到解决的办法,最后我通过自己解决了问题。
这个问题是ssh的报错,我们需要想办法把ssh改成https,这样就可以解决啦,那么下面我来介绍一下如何操作。
首先,如果你遇到128这种报错,不要考虑换镜像啥的,这是一个ssh的错误,改了镜像也会报这种错误,你可以在C盘下的C:\Users\用户名 下找到.gitconfig,然后跟着我改:
在这里插入图片描述
完成之后,你再运行:

npm install --registry=https://registry.npm.taobao.org

问题就解决啦:
在这里插入图片描述
开心的输入:

npm run dev

坐等自动弹窗:
在这里插入图片描述
完美!!!!,解决啦!
有问题,你给我留言,我一定会尽最大的努力帮你解决问题!。

记得点赞哦

评论 23
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值