我在用vue.js的vue-cli工具创建项目的时候出现了connect ECONNREFUSED 192.30.252.137:443 这个问题。
用的淘宝镜像
PS F:\myWeb\1guanggao\qixi2016> vue init webpack
? Generate project in current directory? Yes
vue-cli · connect ECONNREFUSED 192.30.252.137:443
connect ETIMEDOUT 192.30.252.137:443
现在出现这个问题,尝试ping这个地址,结果一直超时
各位知道什么原因导致的,怎么解决吗?
I went and finally solved it after struggling for so long~~~~
I wonder if your host file has been modified?
Because I changed the host to circumvent the wall, and then used lantern to circumvent the wall. Today I accidentally saw someone saying that it is enough to delete the host-related configuration for bypassing the firewall. I deleted the configuration related to github and it really worked. . . If your host has been modified, you can give it a try!
I don’t know the reason, but I guess it is possible that the host file configuration conflicts with the proxy software configuration?
Ask this question
Written on mobile phone,
vue init webpack project-name
Has the questioner solved this problem? I have the same problem and don’t know how to solve it...
To put it simply, the reason is a proxy setting issue.
Specifically, in
vue-cli
, userequest
to query the list of downloadable templates and usedownload-git-repo
to download the corresponding template.request
Modulerequest
does not have a proxy set. You can modify the places wherevue-init
is used in thevue-list
andrequest
files and add the corresponding proxy server settings, such as thevue-init
method incheckDistBranch
:This ensures that
vue-cli
can query the corresponding downloadable template list.download-git-repo
Moduledownload module uses
download-git-repo
, which depends on thedownload
module. Thedownload
module uses thecaw
module, which can read the proxy we set in.npmrc
, so when it is set.npmrc
There will be no problem in the process of downloading the template.Solution
If your network environment requires setting up a proxy server to access the external network, then you need:
Modify the calling method of
request
and add theproxy
attribute.Set up your
.npmrc
file and configure the corresponding proxy server.To be simpler, you can also directly download the corresponding template, such as webpack-simple and place it in the same level directory where
vue init
needs to be executed, so thatvue init
can run successfully.Friendly reminder
Note that the
webpack-simple
template uses thevue 2.0
version. If you want to develop based on the1.x
version, please use thevue init webpack-simple#1.0 my-project
command to specify the template branch.I also encountered the same problem before. After searching for a while, I found that it should be a host problem. I changed my hosts before and restored it to the default state.
Yesterday was good. . After updating to vue-cli version 2.5, I have the same problem as the original po~! ~! ! Ahhhhhhhhhhhhhhhhhhhhhhhh~! ! I don't understand. Find the solution~!