npm install报错
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' (ED25519) 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!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
解决
报错说明:SSH 协议访问 GitHub 仓库时,身份验证失败
- 以ssh://git@开头的远程仓库 URL 自动替换成以https://开头的 URL
git config --global url."https://".insteadOf ssh://git@
# 重新安装
npm install
# 网速过慢(可选)
npm install --registry=https://registry.npm.taobao.org
我遇到的进需要上述操作,更换为http即可解决。
如不行,得自己再找找原因,欢迎评论区留下解决方式。