yarn Retrying… info There appears to be trouble with your network connection.

yarn Retrying… info There appears to be trouble with your network connection._第1张图片

Vue CLI v4.2.2
Failed to check for updates
✨ Creating project in /home/syw/demo
Initializing git repository…
⚙️ Installing CLI plugins. This might take a while…

ERROR Failed to get response from https://registry.npm.taobao.org/binary-mirror-config
yarn install v1.22.0
info No lockfile found.
info There appears to be trouble with your network connection. Retrying…
[1/4] Resolving packages…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
error An unexpected error occurred: “https://registry.npm.taobao.org/@vue%2fcli-plugin-babel: tunneling socket could not be established, cause=connect EINVAL 0.0.31.182:80 - Local (0.0.0.0:0)”.
info If you think this is a bug, please open a bug report with the information provided in “/home/syw/testhh/yarn-error.log”.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
ERROR command failed: yarn


当我利用vue create demo命令创建项目出现以上问题的时候,我从百度上参考了很多种的方法。

1.网速问题,换一个快的网。

​ 虽然可能存在这样的问题,但是可能性比较小。可以尝试测试一下增加网络超时来判断是否存在这样的情况。

yarn install --network-timeout 1000000

2.代理出了问题,一上来就是这么几条命令。(我也没有通过此方法解决问题)

npm config rm https-proxy

yarn config delete proxy

npm config rm proxy

3.更换镜像,讲yarn的镜像改为淘宝镜像。(当然,也还是没有用。。。)

yarn config set registry https://registry.npm.taobao.org

4.清缓存

npm cache clean --force

5.不知道干啥

npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver

Solution

虽然好像也还是一个代理的问题。。。

env | grep -i proxy
#利用全局权限访问配置变量

在这里插入图片描述
一查看,果然是这儿的问题,我前几天乱配代理不知道整了什么玩意儿。然后将他们全都清空。就可以顺利创建vue项目了。但是这样只是修改了当前终端的环境变量。否则重新开启一个终端还是没有修改这些值。

https_proxy=
http_proxy=
ftp_proxy=

所以我们需要修改当前用户的环境变量。

vim ~/.bashrc

利用该命令打开文件修改环境变量即可使用到当前用户所有的终端。

你可能感兴趣的:(yarn Retrying… info There appears to be trouble with your network connection.)