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

npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/adobe-webplatform/eve.git
npm ERR! [email protected]: 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 ERR code 128 npm ERR An unknown git error occurred npm ERR command git --no-replace-objects l_第1张图片
开心的输入:

npm run dev

坐等自动弹窗:
npm ERR code 128 npm ERR An unknown git error occurred npm ERR command git --no-replace-objects l_第2张图片
完美!!!!,解决啦!
有问题,你给我留言,我一定会尽最大的努力帮你解决问题!。

记得点赞哦

你可能感兴趣的:(git,npm,github)