【教程】npm的时候ssh报错ssh://git@github.com/frozeman/bignumber.js-nolookahead.git

问题:

fisco@ubuntu:~/fisco/benchmarks$ npm install install web3@0.20.7

npm ERR! code 128

npm ERR! An unknown git error occurred

npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/frozeman/bignumber.js-nolookahead.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: /home/fisco/.npm/_logs/2024-01-22T07_08_36_162Z-debug-0.log

解决方案

bash 复制代码
ssh-keygen -t rsa -b 4096 -C "github账号"

这里写入你自己的github账号,一般都是用邮箱注册的

运行后输入这个代码

bash 复制代码
eval "$(ssh-agent -s)"

在将新生成的账号加入

bash 复制代码
ssh-add ~/.ssh/id_rsa
bash 复制代码
cat ~/.ssh/id_rsa.pub
  1. 打开 GitHub 网站,并登录到你的账户。

  2. 转到右上角的用户头像,点击下拉菜单,选择 "Settings"。

  3. 在左侧导航栏中,选择 "SSH and GPG keys"。

  4. 点击 "New SSH key" 或 "Add SSH key"。

  5. 在 "Title" 字段中,可以为密钥设置一个描述性的名称,以便识别。在 "Key" 字段中,粘贴你之前生成的 SSH 公钥。

  6. 确保你已经添加了正确的公钥,然后点击 "Add SSH key" 按钮。

再去执行就完成了

相关推荐
szxinmai主板定制专家38 分钟前
电力设备RK3568/RK3576+FPGA,多系统混合部署Linux+RTOS RT-THREAD,强实时性
linux·运维·服务器·人工智能·嵌入式硬件·fpga开发
我是坑货1 小时前
Jenkins 构建失败排查记录:mvn -U 把新版依赖被远程旧版覆盖
运维·jenkins
L、2181 小时前
CANN调优工具链全景:从profiler到tensorboard的完整观测体系
linux·运维·服务器·深度学习
码点滴2 小时前
Workload 自动化进化论:从手动运维到 AI 驱动的 Kubernetes 智能管控
运维·人工智能·kubernetes·自动化·workload
darkdragonking2 小时前
Docker(五)OpenEuler22.03 安装docker ce、排坑
运维·docker·容器
j_xxx404_2 小时前
Linux进程信号捕捉与操作系统运行本质深度解析
linux·运维·服务器·开发语言·c++·人工智能·ai
eggrall2 小时前
Linux信号——保存信号
linux·运维·服务器
2501_920047032 小时前
firewalld的使用
linux·运维
孙高飞2 小时前
直播预告 - 周日晚 7 点半-AI 驱动 UI 自动化
运维·自动化
qq_196976173 小时前
硬核多语言办公方案:基于Gemini境像站的实时翻译与双语文档自动化生成管道(国内免费镜像实测)
运维·自动化