npm ERR! git@github.com: Permission denied (publickey).
直接回车,系统会在 .ssh 文件夹下生成两个文件,id_rsa 和 id_rsa.pub 文件,使用记事本打开 id_rsa.pub。打开:https://github.com/,进入设置 - >SSH and GPG keys - > SSH keys。原因是需要在 github 上设置 ssh 密钥,否则没有权限获取文件。输入命令: ssh-keygen -t rsa -C ''your@e
转载于:https://www.cnblogs.com/web-learn/p/16326193.html
问题描述:
npm ERR! commandgit --no-replace-objects ls-remote ssh://git@github.com/nhn/raphael.git
npm ERR! git@github.com: Permission denied (publickey).
…
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 。
复制文件内容。
第二步:打开 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.
此时提示我们设置成功,已经拥有权限了!
更多推荐
所有评论(0)