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

安装 npm install时的错误提示

npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/nhn/raphael.git
npm ERR! Warning: Permanently added 'github.com,20.205.243.166' (ECDSA) to the list of known hosts.
npm ERR! [email protected]: 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,打开

 npm ERR code 128npm ERR An unknown git error occurrednpm ERR command git --no-replace-objects l_第1张图片

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

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

 npm ERR code 128npm ERR An unknown git error occurrednpm ERR command git --no-replace-objects l_第2张图片

 

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

 npm ERR code 128npm ERR An unknown git error occurrednpm ERR command git --no-replace-objects l_第3张图片 

 

 f5e7ee7a938f4db2a3a67f41bc73df49.png

最后 npm ERR code 128npm ERR An unknown git error occurrednpm ERR command git --no-replace-objects l_第4张图片

 

 

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

 

 

你可能感兴趣的:(css,html,JavaScript,vue,github,vue.js)