目录

  • 1.案发现场
  • 2 故障分析
  • 3 解决方案
  • 4. 参考文献

1.案发现场

当执行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! git@github.com: Permission denied (publickey).
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\XXXX\AppData\Local\npm-cache\_logs\2023-01-03T07_20_29_806Z-debug-0.log

2 故障分析

错误日志中有如下关键信息:

Please make sure you have the correct access rights npm ERR! and the repository exists.

意思是我们对这个仓库没有操作权限,但是按说不可能哈,这是一个github 开源库,不应该需要权限哈。

仔细观察未登录github访问这个仓库发现:

??? 压根没有ssh 下载选项

github 登陆后再看看发现有了。

顿时明了,由于这个前端开源框架很坑的下载第三方依赖用的是ssh ssh://git@github.com/nhn/raphael.git 方式下载,

而这种方式下载,必须配置了访问github 的ssh key 才可以

3 解决方案

配置访问github 的ssh key 即可。

如果有多个代码仓库,可以通过 .ssh/config 分别配置多个ssh key 即可。

示例如下:

# github
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa# aliyun code
Host git@code.aliyun.com
HostName git@code.aliyun.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa# aliyun code up
Host git@codeup.aliyun.com
HostName git@codeup.aliyun.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa# company gitlab
#Host git.xxxx.cn
#HostName git.xxx.cn
#PreferredAuthentications publickey
#IdentityFile ~/.ssh/company_id_rsa

具体生成ssh key 方法 参考 阿里云Code SSH KEY 代码入库

4. 参考文献

  • 同一台电脑为多个代码仓库平台配置不同的git账号
  • 阿里云Code SSH KEY 代码入库

command git --no-replace-objects ls-remote ssh://git@github.com/nhn/raphael.git npm ERR相关推荐

  1. fatal: unable to access ‘https://github.com/nhn/raphael.git/‘: OpenSSL SSL_read: Connection was rese

    错误1: npm ERR! fatal: unable to connect to github.com 解决方案: ssh访问切换为https访问 git config --global url.& ...

  2. vue初始化项目出现unable to access ‘https://github.com/nhn/raphael.git/’解决有效 2021-12-30

    vue初始化项目出现 npm ERR! fatal: unable to access 'https://github.com/nhn/raphael.git/': OpenSSL SSL_read: ...

  3. code 128 ....command git --no-replace-objects ls-remote ssh://git@github.com/nhn/raphael.git解决方案

    vue-element-admin项目 当安装依赖npm install 时报错 npm ERR! code 128 npm ERR! An unknown git error occurred np ...

  4. npm ERR,fatal: unable to access ‘https://github.com/nhn/raphael.git/‘: OpenSSL SSL_read: Connection

    vue 初始化项目出现:npm ERR! fatal: unable to access 'https://github.com/nhn/raphael.git/': OpenSSL SSL_read ...

  5. npm ERR D:\Program Files\Git\cmd\git.EXE ls-remote -h -t https://github.com/nhn/raphael.git

    问题描述 在npm install时出现以下问题: npm ERR! Error while executing: npm ERR! D:\Program Files\Git\cmd\git.EXE ...

  6. C:\Program Files\Git\cmd\git.EXE ls-remote -h -t https://github.com/nhn/raphael.git

    报错 npm ERR! Error while executing: npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t https:/ ...

  7. vue初始化项目出现 npm ERR! fatal: unable to access ‘https://github.com/nhn/raphael.git/‘: OpenSSL SSL_read:

    vue初始化项目出现npm ERR! fatal: unable to access 'https://github.com/nhn/raphael.git/': OpenSSL SSL_read:错 ...

  8. npm install下载依赖项时报错 fatal: unable to access ‘https://github.com/nhn/raphael.git/‘: Failed to connect

    解决方案: 1:查看一下自己的node版本,一般高版本下载会出问题,建议使用 12.17.0版本 2:网络延迟的问题,删除package.lock.json和node_modules文件夹,重新ins ...

  9. Git学习(了解版本控制、Git安装配置、Git基本理论、Git搭建、Git文件操作、使用码云或Github、IDEA集成Git,Git分支开发)

    学习git之前,我们需要先明白一个概念,版本控制! 版本控制 什么是版本控制 版本迭代,新的版本!版本管理器. 版本控制(Revision Control)是一种在开发的过程中用于管理我们对文件.目录 ...

最新文章

  1. 软件测试实验——安装并使用junit、hamcrest和eclemma进行简单测试
  2. JSTL解析——001
  3. UNITY 优化之带Animator的Go.SetActive耗时问题,在手机上,这个问题似乎并不存在,因为优化了后手机上运行帧率并未明显提升...
  4. Java黑皮书课后题第2章:2.3(将英尺转化为米)编写程序,读入英尺数,将其转换为米数并显示结果。1英尺等于0.305米
  5. [TP5填坑]关于助手函数input一不小心取不到get值的解决办法
  6. wince下获取mac地址的简单方法!
  7. 移植性问题のerror C2664: strcpy : 不能将参数 2 从 CString 转换为 const char *怎么回事?...
  8. python连接mysql查询数据返回字典格式
  9. linux修改web密码忘记,Ubuntu 直接修改IPMIweb登录密码
  10. JAVA怎么出现10行10列的星号_C语言输出n行n列星号
  11. 挖一挖那些让公司网站瘫痪的SQL“终结者”
  12. pycharm用阿里云镜像_新购买的阿里云服务器准备到期时能否用学生身份优惠续费?...
  13. 联合作战效能评估软件
  14. 郝斌 mysql_郝斌–SQL Server2005学习笔记
  15. 荐书丨《好奇心的秘密》:一个针尖上可以站多少跳舞的小天使?
  16. 服务器503网页报错,网页为什么出现503错误?网页503错误的解决方法
  17. Python网页应用开发神器fac框架正式发布
  18. 移动端获取手机自带的返回键并添加事件。
  19. 这一篇带你学点儿 Java8 中的流式数据处理
  20. 海洋cms index.php被修改,海洋CMS(SEACMS)新版本V6.55补丁仍可被绕过执行任意代码...

热门文章

  1. 水处理小知识:养殖场废水脱色剂除色又除臭
  2. 虚拟现实军事模拟训练解决方案
  3. Javascript FLOT画图插件详解
  4. SpringBoot配置Cors解决跨域请求问题
  5. Initialization failure:0x0000000C
  6. 摩天大楼里的云服务器
  7. gcc的-g,-o,-c,-D,-w,-W,-Wall,-O3等参数的意义
  8. python batch normalization_Batch Normalization的正确打开方式
  9. qregplot:分位数回归图示
  10. oracle TRUNC()