安装 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! Warning: Permanently added 'github.com,20.205.243.166' (ECDSA) to
the list of known hosts.
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR! and the repository exists.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\nodejs\node_cache\_logs\2022-04-27T08_23_27_820Z-debug-0.log

尝试了很多种方法比如:npm cache clean --force

然后再:npm install

反正都是错误的

然后看了另外一个大佬的博文最终成功解决问题 

第一步:在你的电脑上 的开始里面找到一个Git文件夹,然后打开Git Bush,或者直接在桌面右键找到Git Bush here,打开

 

 之后你的c盘->用户->你的用户名->.ssh文件中会生成两个新的文件,一个叫id_rsa.pub

另一个是id_rsa,打开id_rsa.pub文件,将你刚刚复制的信息粘贴进去然后保存。每个人的信息都可能不同

 

 

然后再打开GitHub网站找到右上角你的账户,在找到settings

  

 

 

最后 

 

 

最后重新曲安装依赖就OK了 

 

 

 

技术
今日推荐
PPT
阅读数 128
下载桌面版
GitHub
百度网盘(提取码:draw)
Gitee
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:766591547
关注微信