創建Vue項目vue-cli · Failed to download repo vuejs-templates/webpack: connect ETIMEDOUT


用vue-cli創建項目時顯示超時,原因可能是github.com訪問不了,用ping命令試一下,顯示請求超時

 點擊查看github.com域名解析之后的ip地址https://github.com.ipaddress.com/https://fastly.net.ipaddress.com/github.global.ssl.fastly.net

 github.global.ssl.fastly.net

 

 根據當前解析的ip地址修改本地的hosts文件,路徑為C:\Windows\System32\drivers\etc\hosts,使用管理員身份打開,在后面累加剛才查看的ip地址

140.82.112.3   github.com
199.232.69.194   github.global.ssl.fastly.net	

修改完之后的hosts文件為

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost

140.82.112.3   github.com
199.232.69.194   github.global.ssl.fastly.net			

重新打開命令行窗口 

ping github.com

 可以看到當前接受100%,可以繼續創建項目,顯示創建成功。

 希望對您有所幫助。。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM