the ECDSA host key for 'github.com' differs from the key for the IP address 日期:2023-07-28 人气:712 今天克隆项目之后,重新安装npm依赖包报错如下: ``` npm ERR! code 128 npm ERR! An unknown git error occurred npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/angular/web-animations-js.git npm ERR! Warning: the ECDSA host key for 'github.com' differs from the key for the IP address '20.205.243.166' npm ERR! Offending key for IP in /c/Users/SZLD-PC-109/.ssh/known_hosts:12 npm ERR! Matching host key in /c/Users/SZLD-PC-109/.ssh/known_hosts:23 npm ERR! Exiting, you have requested strict checking. npm ERR! Host key verification failed. 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\SZLD-PC-109\AppData\Local\npm-cache\_logs\2023-07-28T07_27_03_040Z-debug-0.log ``` 网上搜索一下,原来是git证书过期了,需要删除重新添加一下 ``` ssh-keygen -R 20.205.243.166 ssh-keyscan github.com >> ~/.ssh/known_hosts ``` ### 鸣谢 - [后除](https://blog.mazey.net/3284.html) - [简书**overhaha**](https://www.jianshu.com/p/b255f743eb8b) 标签: 上一篇:后记《向阳生长,爱在感恩》文集 下一篇:GB/T 18894-2016——电子文件归档与管理规范 随便看看 2026-01-12 后记《向阳生长,爱在感恩》文集 2026-01-12 《向阳生长,爱在感恩》文集 2026-01-12 自序《向阳生长,爱在感恩》文集 2026-01-12 序言《向阳生长,爱在感恩》文集 2026-01-08 如何使用mvn命令导入依赖 留言