git@github.com: Permission denied (publickey).
E:\code\vue-element-admin>npm install --registry=https://registry.npm.taobao.org
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/adobe-webplatform/eve.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:
npm ERR! C:\Users\Think\AppData\Local\npm-cache\_logs\2022-06-19T12_49_22_372Z-debug-0.log
进入git bash界面然后:
第1步,git config --global --list 验证邮箱与GitHub注册时输入的是否一致。可以通过git config –global user.name “yourname”,git config --global user.email “email@email.com ”(这里得名字和邮箱都是注册github时用的)设置全局用户名和邮箱。
git config --global --list
使用 ssh-keygen -t rsa -C “这里换上你的邮箱”,**一路回车**,在出现选择时输入Y,再一路回车直到生成密钥。
ssh-keygen -t rsa -C 763906783@qq.com
会在/Users/***/路径下生成一个.ssh文件夹,密钥就存储在其中:
用文本工具打开id_rsa.pub文件,内容如下:
使用 ssh -T git@github.com 测试一下通不通,通了显示如下
ssh -T git@github.com
这时候你的问题就解决啦。
npm install --registry=https://registry.npm.taobao.org