vue-element-admin npm install 报错
vue-element-admin 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! no such identity: /c/Users/masterlin/.ssh/github_id_rsa: No such file or directory
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\masterlin\AppData\Local\npm-cache\_logs\2022-01-03T09_29_27_844Z-debug-0.log
no such identity: /c/Users/masterlin/.ssh/github_id_rsa: No such file or directory
1.没有.ssh/github_id_rsa文件。
找到ssh文件夹:"C:\Users\masterlin.ssh"文件夹,然后在这个文件夹打开cmd,执行以下命令,替换你自己的邮箱
ssh -keygen -t rsa -C "your_email@example.com"
回车
输入密码
再次确认密码
然后生成github,的公钥id_rsa.pub和私钥id_rsa
将公钥添加到github的ssh keys上。
再次运行npm install
还是出错,再细看
原来生成的公钥文件名为id_rsa.pub,而项目需要的文件名为github_id_rsa。
改名后,再次运行 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/adobe-webplatform/eve.git
npm ERR! Load key "/c/Users/masterlin/.ssh/github_id_rsa": invalid format
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\masterlin\AppData\Local\npm-cache\_logs\2022-01-03T09_37_54_026Z-debug-0.log
Load key "/c/Users/masterlin/.ssh/github_id_rsa": invalid format
2. .ssh/github_id_rsa文件文件格式不正确
这次不再是文件不存在,而是文件格式不正确
再次查找问题,最后是生成的公钥的格式是新格式
强制 openSSH 生成旧格式:
ssh-keygen -m PEM -t rsa -P "" -f filename
命令 ssh-keygen -t rsa 生成ssh,默认是以新的格式生成,id_rsa的第一行变成了“BEGIN OPENSSH PRIVATE KEY” 而不在是“BEGIN RSA PRIVATE KEY”
最后换成旧格式,
npm install
成功下载依赖,
npm run dev
成功运行项目
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 一文读懂知识蒸馏
· 终于写完轮子一部分:tcp代理 了,记录一下