【教程】npm的时候ssh报错ssh://[email protected]/frozeman/bignumber.js-nolookahead.git

问题:

fisco@ubuntu:~/fisco/benchmarks$ npm install install [email protected]

npm ERR! code 128

npm ERR! An unknown git error occurred

npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/frozeman/bignumber.js-nolookahead.git

npm ERR! [email protected]: 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" 按钮。

再去执行就完成了

相关推荐
Harbor Lau8 分钟前
Linux常用中间件命令大全
linux·运维·中间件
漫谈网络26 分钟前
基于 Netmiko 的网络设备自动化操作
运维·自动化·netdevops·netmiko
꧁坚持很酷꧂1 小时前
Linux Ubuntu18.04下安装Qt Craeator 5.12.9(图文详解)
linux·运维·qt
小诸葛的博客2 小时前
详解Linux中的定时任务管理工具crond
linux·运维·chrome
一默19912 小时前
CentOS 7.9升级OpenSSH到9.9p2
linux·运维·centos
BranH3 小时前
Linux系统中命令设定临时IP
linux·运维·服务器
极小狐4 小时前
极狐GitLab 项目功能和权限解读
运维·git·安全·gitlab·极狐gitlab
宁酱醇4 小时前
GitLab_密钥生成(SSH-key)
运维·ssh·gitlab
秋风起,再归来~4 小时前
【Linux庖丁解牛】—进程优先级!
linux·运维·服务器
Lalolander4 小时前
设备制造行业如何避免项目管理混乱?
运维·制造·工程项目管理·四算一控·epc·环保设备工程·设备制造