今天在部署基于vue、elementUI的中后台管理前端项目,git克隆,进行项目安装依赖的时候出现了一下错误:
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! 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.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Local\npm-cache\_logs\2021-11-23T09_18_07_476Z-debug.log
``
解决方案:
-
桌面右键找到git bash here -
输入命令ssh-keygen -t rsa -C “你的邮箱名称” overwrite 输入y 输入密码时直接回车重复密码输入还是直接回车 -
把github上以前的sshkeys删除 -
配置新的sshkey,找到c盘->用户->你的用户名->.ssh->id_rsa.pub里边的字符添加 github右上角头像->settings->ssh & GPG ->Add sshKeys
|