vue-element-admin执行npm install 报错解决方法

下载vue-element-admin后,根据官网说明,执行npm install ,报如下错误,执行了三次,都是报下面这样的错误:

npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://[email protected]/s
eonim-ryu/Squire.git
npm ERR!
npm ERR! undefined
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\10190340\AppData\Roaming\npm-cache\_logs\2019-11-21T08_22_
08_820Z-debug.log

百度了一下,执行:

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

然后再去npm install 就正常了

分析原因:

因为当你想去克隆一个别人github上的repository时,发现系统不让你动,提示你防火墙禁止对git://的访问,这时候就只能用https://来访问repository。

执行 git config --global url."https://".insteadOf git:// 后,你会发现在你的文件 .gitconfig中会多出一行

1 [url "https://"]   
2        insteadOf = git://

这个时候,你就可以以后不管你在终端进行clone,使用git://,或者http://去访问别人的repository,两种方式都会默认变成http://的形式进行连接并正常的工作了。

发布了99 篇原创文章 · 获赞 60 · 访问量 30万+

猜你喜欢

转载自blog.csdn.net/lengyuewusheng99/article/details/103189477