npm install 失败 fatal: Could not read from remote repository

发布时间 2023-04-22 12:03:38作者: wangjin_1

npm install  项目拉下来后需要安装依赖。

内控项目报错

RR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/nhn/raphael.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!     E:\software\node-v18.15.0-win-x64\node_cache\_logs\2023-04-21T08_54_49_353Z-debug-0.log

借鉴

https://blog.51cto.com/u_15476057/4925497?b=totalstatistic

借鉴

https://www.jianshu.com/p/80f7f2de0311

https://blog.csdn.net/qq_40374604/article/details/128062039

输入命令:

git config --global http.sslverify "false"

git config --global url."https://".insteadOf git://

然后 

npm  install  --force 

失败

生成ssh试试

https://blog.csdn.net/qq_40374604/article/details/128062039

 

github 增加key 

本地生成 id_rsa.pub  将信息新增到github 上

https://blog.csdn.net/qq_40047019/article/details/122898308

成功