解决Vue init时报错 connect ETIMEDOUT 192.30.253.113:443

博主 1075 2020-07-26

最近一次在执行vue init时,download template 卡死,然后报错timeout

这个错误是由于下载文件时连接github出错,无法连接到github.com,故无法下载,超时

首先检查本地host文件,检查有无对github配置本地映射

有则取消映射,然后ping github.com

若超时,登录网站 http://ping.chinaz.com/github.com
找到不超时的ip
image.png

在本地host文件添加映射
140.82.113.3 github.com

然后执行vue init webpack xxx,体验飞一般的感觉

参考:
https://blog.csdn.net/beixishuo/article/details/104242984