【教程】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
 

解决方案

ssh-keygen -t rsa -b 4096 -C "github账号"

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

运行后输入这个代码

eval "$(ssh-agent -s)"

在将新生成的账号加入

ssh-add ~/.ssh/id_rsa

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" 按钮。

再去执行就完成了

 

相关推荐

  1. 解决常见 `npm install`

    2024-01-23 06:56:06       28 阅读
  2. npm install

    2024-01-23 06:56:06       44 阅读
  3. git pull时候

    2024-01-23 06:56:06       49 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-23 06:56:06       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-23 06:56:06       106 阅读
  3. 在Django里面运行非项目文件

    2024-01-23 06:56:06       87 阅读
  4. Python语言-面向对象

    2024-01-23 06:56:06       96 阅读

热门阅读

  1. 自然语言处理的发展

    2024-01-23 06:56:06       56 阅读
  2. pytorch模型转caffe模型

    2024-01-23 06:56:06       53 阅读
  3. NPM: 如何修改npm源?

    2024-01-23 06:56:06       49 阅读
  4. bfs广度优先搜索

    2024-01-23 06:56:06       47 阅读
  5. 【Spring Boot 3】【Redis】集成Redisson

    2024-01-23 06:56:06       54 阅读
  6. Unity3D 协程的优缺点详解

    2024-01-23 06:56:06       55 阅读
  7. 网络工程师:新兴科技基础知识面试题(十三)

    2024-01-23 06:56:06       52 阅读
  8. 数据库系列文章之 ClickHouse入门

    2024-01-23 06:56:06       45 阅读
  9. 计算机网络(第六版)复习提纲7

    2024-01-23 06:56:06       61 阅读
  10. FFmpeg教程:libswscale对图像进行简单处理

    2024-01-23 06:56:06       59 阅读
  11. SQL基础知识(三)

    2024-01-23 06:56:06       48 阅读
  12. mockjs(3)

    mockjs(3)

    2024-01-23 06:56:06      46 阅读
  13. ffmpeg实现视频解码

    2024-01-23 06:56:06       60 阅读