赞
踩
PS D:\code\www\4.0_backview> 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! 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\pc\AppData\Local\npm-cache\_logs\2022-01-19T01_46_52_518Z-debug.log
操作一: 检查.gitconfig文件
win10一般在: /c/Users/pc/.gitconfig
在最底部添加:
# 将git://的都替换成https
[url "https://github.com/nhn/raphael.git/"]
insteadOf = git://github.com/nhn/raphael.git/
再次npm install , 无果, 再看操作二
操作二: github添加ssh
ssh-keygen -t rsa -b 2048 -C "你自己的邮箱地址"
# 回车后如果你需要填写多个ssh, 则直接写绝对路径, eg: /c/Users/pc/.ssh/github_id_rsa, 防止与gitee有相冲突的文件
cat ~/..sh/github_id_rsa.pub
# 复制到github ssh
再试一试
出现443的, 再跑多几次就好了, 已经不是上面出现的问题点了, 只是国内网络连通的问题, 你懂的~
PS D:\code\www\4.0_backview> npm install --registry=https://registry.npm.taobao.org
npm ERR! code 128
npm ERR! A git connection error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/nhn/raphael.git
npm ERR! fatal: unable to access 'https://github.com/nhn/raphael.git/': Failed to connect to github.com port 443: Timed out
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\pc\AppData\Local\npm-cache\_logs\2022-01-19T02_11_27_611Z-debug.log
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。