这篇文章上次修改于 801 天前,可能其部分内容已经发生变化,如有疑问可询问作者。

配置代理(http://127.0.0.1:8118)后,可能出现 yarn install 失败,提示网络错误。

解决方式一:

yarn config set proxy http://127.0.0.1:8118
yarn config set https-proxy http://127.0.0.1:8118
git config --global http.proxy http://127.0.0.1:8118

解决方式二:删除 http 代理,仅保留 socks5 代理即可。

npm config rm proxy
npm config rm https-proxy
npm config rm http-proxy
yarn config delete proxy
yarn config delete https-proxy
yarn config delete http-proxy

参考:
https://stackoverflow.com/questions/51508364/yarn-there-appears-to-be-trouble-with-your-network-connection-retrying