赞
踩
npm install 执行报错 fatal: Could not read from remote repository:
npm ERR! Error while executing:
npm ERR! d:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://git@github.com/sohee-lee7/Squire.git
npm ERR!
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!
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! D:\Program Files\nodejs\node_cache\_logs\2022-05-11T02_16_46_757Z-debug.log
原因是 GitHub 的客户端与服务端未生成 ssh key 或 ssh key 不匹配,需要重新生成。
ssh-keygen -t rsa -C "youremail@example.com"
选择 “Settings” –> “SSH and GPG keys” –> “New SSH key” ,将 id_rsa.pub 文件的密钥复制后填写进去:
使用 ssh -T git@github.com 对 SSH key 进行验证:
ssh -T git@github.com
The authenticity of host 'github.com (20.205.243.166)' can't be established.
ECDSA key fingerprint is SHA256:p2QAMXNICxxxxxIOttrVc98/R1BUFWu3/LiyKgUfQM.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com,20.205.243.166' (ECDSA) to the list of known hosts.
Hi xxxxx! You've successfully authenticated, but GitHub does not provide shell access.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。