npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/adobe-webplatform/eve.git

问题描述:

npm ERR! code 128

An unknown git error occurred

npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/adobe-webplatform/eve.git

......

Please make sure you have the correct access rights

 

 原因是需要在 github 上设置 ssh 密钥,否则没有权限获取文件。要先设置用户和邮箱再重新生成ssh公钥即可。

解决办法:

第一步:首先在 git 设置一下邮箱,当前文件下打开 git bash 

输入命令: ssh-keygen -t rsa -C ''your@email.com",设置你的邮箱地址。

出现:

Generating public/private rsa key pair.

Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):

直接回车,系统会在 .ssh 文件夹下生成两个文件,id_rsa 和 id_rsa.pub 文件,使用记事本打开 id_rsa.pub 。

或使用命令:clip < ~/.ssh/id_rsa.pub

复制文件内容。

第二步:打开 github ,进入设置,进行添加密钥。

打开:https://github.com/,进入设置 - >  SSH and GPG keys - > SSH keys。

 

 

第三步:检查是否设置成功!

返回到 ssh base ,

输入命令:ssh -T git@github.com

 

 Hi xiaomageqq! You've successfully authenticated, but GitHub does not provide shell access.

此时提示我们设置成功,已经拥有权限了!

 

posted @   前端人  阅读(2379)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· Obsidian + DeepSeek:免费 AI 助力你的知识管理,让你的笔记飞起来!
· 解决跨域问题的这6种方案,真香!
· 5. Nginx 负载均衡配置案例(附有详细截图说明++)
· Windows 提权-UAC 绕过
点击右上角即可分享
微信分享提示