【教程】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" 按钮。

再去执行就完成了

相关推荐
yuanzhengme几秒前
Ollama【部署 07】搭建本地智能体的简单说明(局域网离线部署Ollama+模型迁移+Docker部署AnythingLLM)
运维·docker·容器·大模型·ollama·本地智能体
运维老郭15 分钟前
Kubernetes 二进制部署完全指南:从零搭建生产级HA集群
运维·云原生·kubernetes
MXsoft61827 分钟前
## 告警治理:从“风暴”到“精准”——运维告警压缩与根因定位实践指南
运维
MXsoft61836 分钟前
**智慧校园哑终端监控:摄像头、门禁、信息屏的统一管理实践**
运维
唐墨12342 分钟前
关于linux kernel错误码为负数编码这件事情,我个人的一些看法
linux·运维·服务器
IT WorryFree1 小时前
基于Fortinet MIB实现设备资产管理完整方案
运维·服务器·网络
鼎讯信通1 小时前
宽频高敏・全域监测|鼎讯 DXMP 系列,打造风电射频侦测新范式
运维·能源·信息与通信
网络系统管理1 小时前
第八届江苏技能状元大赛选拔赛信息通信网络运行管理项目模块D网络服务与系统运维-Linux样题
linux·运维
Sunny_20228371 小时前
CAD在执行移动命令的时候按正交F8,老是卡住
运维·pccad插件、cad·pccad个人免费版·免费cad插件
零陵上将军_xdr1 小时前
Shell流程控制:if/case/for/while让脚本活起来
linux·运维·服务器