在github下载的项目运行时,进行npm install安装依赖时,出现如下错误:
npm ERR! 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! C:\Users\Acer\AppData\Local\npm-cache\_logs\2023-02-09T12_33_12_237Z-debug-0.log
报错图片:

解决办法:
实际产生错误的原因是ssh密钥的问题,只要在github添加上密钥就可以了。
查找ssh密钥:c盘->user(用户)->主机名字->.ssh
然后复制文件里面的内容到github上。


重新运行npm istall,即可解决。