安装vue-element-admin时npm install报错:Please make sure you have the correct access rights and the repository exists.

以下为npm install后报错的提示:

PS F:\AA\vue-element-admin-i18n> npm install
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/nhn/raphael.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\LJW\AppData\Local\npm-cache\_logs\2022-08-08T12_48_25_162Z-debug-0.log

翻译过来就是

npm ERR! code 128 -----------错误码128

npm ERR! An unknown git error occurred---------------发生未知的git错误

npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/nhn/raphael.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\LJW\AppData\Local\npm-cache\_logs\2022-08-08T12_48_25_162Z-debug-0.log

解决方法:

方法1:不行

git config --global http.sslverify "false"

方法2:也不行

git config --global url."https://".insteadOf git://

上面的两种方法是网上搜到的大部分都说这样能解决,可能有的人能解决吧。我反正是不行。

方法3:行

 桌面右键,git bash here 输入以下 ssh-keygen -t rsa -C “123456@qq.com” 如下图

然后打开C:\Users\你的用户\.ssh文件夹下会多出两个文件,id_rsa.pub和id_rsa,这个known_hosts文件是本来就有的,打开id_rsa.pub复制里面的全部内容。

然后用你上面填的邮箱登录github.com 如下图将复制的内容粘贴到Key的区域,然后Add SSH key就可以了。回去继续npm install

 

posted @ 2022-08-08 22:47  井韦  阅读(2480)  评论(1编辑  收藏  举报