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

再去执行就完成了

相关推荐
天远数科7 小时前
零信任架构实战:基于天远车辆出险记录核验构建自动化信贷网关
运维·人工智能·架构·自动化
码农阿豪7 小时前
Seedance 2.0/2.5 虚拟素材能跨 Key 共用吗?一次讲清 Asset ID、账号隔离与 SaaS 素材架构
java·运维·架构
刘某的Cloud8 小时前
k8s部署prometheus架构规则
linux·运维·kubernetes·prometheus·监控
Ningcode_cloud8 小时前
什么是CICD? GitLab + Jenkins 持续集成实战部署手册
运维·ci/cd·云原生·容器·gitlab·jenkins
好评1248 小时前
【Linux】传输层协议UDP
linux·运维·udp
JZZC28 小时前
1.1 基础的SSH配置
计算机网络·ssh
Csxyzj8 小时前
基于Linux+Docker NAT的Ollama多实例负载均衡部署
运维·docker·容器
流光D8 小时前
AI时代,搭建 web 站点并配置 nginx 反向代理流程
运维·服务器·前端·人工智能·nginx·ai·ai编程
GreatVicent8 小时前
AI Agent互操作标准化加速:A2A协议正式加入Linux基金会
linux·运维·人工智能·agent·aws·a2a
Huangjin007_9 小时前
【Linux 系统篇(十六)】进程(四) : 僵尸进程、孤儿进程、进程优先级
linux·运维·服务器