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

再去执行就完成了

相关推荐
软件测试慧姐3 分钟前
精简版-Linux常用命令
linux·运维·服务器
wanhengidc4 分钟前
G口服务器都有哪些作用?
运维·服务器·科技·云计算
Swift社区7 分钟前
LeetCode 439 - 三元表达式解析器
算法·leetcode·ssh
ljj2535575051__7 分钟前
nginx的https的搭建
运维·nginx·https
上海云盾-小余12 分钟前
系统漏洞扫描原理,什么是系统漏洞?
运维·安全·网络安全·ddos
JaHeng072315 分钟前
nginx的https搭建
运维·nginx·https
TDengine (老段)20 分钟前
TDengine 运维命令 SCAN 使用手册
大数据·运维·数据库·物联网·时序数据库·tdengine·涛思数据
dishugj22 分钟前
Linux系统磁盘性能相关命令详解与实例分析
linux·运维·服务器
南风~古草34 分钟前
20252803《Linux内核原理与分析》第12周作业-Linux系统监控实战(系统安全实验)
linux·运维·系统安全
TsingtaoAI38 分钟前
企业实训:AI运维工程师实训——某外资商业银行
运维·人工智能