yarn install 时提示无法连接 github

在使用 yarn install 安装依赖包时,提示如下错误:

1
2
3
4
5
6
Command: git
Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
Directory: D:\Develop\BIM\swToolsFrontEnd
Output:
fatal: unable to connect to github.com:
github.com[0: 20.205.243.166]: errno=Unknown error

在上面的错误中,我们可以找到错误关键词 git:unable to connect to github.com,根据此信息,我们便可定位错误。

引发上述错误是因为 git 弃用了 git: 协议,所以只需要将 git 中的 git: 协议改成 https: 即可,命令如下:

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