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

再去执行就完成了

相关推荐
Star(up up up)33 分钟前
Docker系列---Docker容器基本命令(新手小白保姆级实操教程)
运维·学习·程序人生·青少年编程·docker·容器·dubbo
echome8881 小时前
Linux 定时任务:crontab 写法与常见失效原因
linux·运维·网络·定时任务·crontab
老约家的可汗1 小时前
Linux开发三件套:make、git、gdb 入门指南
linux·运维·服务器
分布式存储与RustFS2 小时前
可观测性数据落进对象存储:Proscia 案例拆解与 ClickHouse 自托管配置
运维·云原生·开源·对象存储·分布式存储·s3·性能基准
方便面不加香菜2 小时前
Docker Image-- 镜像命令详解与使用示例
运维·docker·容器
天远API3 小时前
零信任架构实战:基于天远劳动仲裁信息查询构建自动化灵活用工劳务派遣人员准入背调网关
运维·人工智能·架构·自动化
程序员大雄学编程3 小时前
Linux 磁盘满了怎么排查?df / du / find 三步定位大文件
linux·运维·php
Bruce_Liuxiaowei3 小时前
前端校验登录态,等于没校验——一次应急广播终端高危漏洞的发现与报送
运维·前端·安全
时间售卖铺4 小时前
Docker私有仓库搭建与实战指南
运维·docker·云原生·容器
快乐的熊二4 小时前
每天自动领积分:Trae CN + WorkBuddy 签到自动化
运维·自动化