yarnpkg/yarn

yarn需要像npm一样配置代理么?

yuanyuanshen opened this issue · 8 comments

公司网络需要配置代理。npm配置完可以正常下载依赖包,但是安装完yarn之后连不上网,
yarn config set proxy http://XX 依然连不上网

可以列出你用的步骤吗? 不太懂 “安装完yarn之后连不上网” 是什么意思。你是不是有自己的npm服务器?

Make sure you also set the HTTPS proxy.
确保您还设置HTTPS代理。 ( from Google Translate. Hope that is close enough to understand 😃 )

yarn config set proxy http://XX
yarn config set https-proxy http://XX

maybe yarn config set strict-ssl false is useful, too.

用shadowsocks NG的话,设置开启HTTP代理服务器,监听地址改为0.0.0.0
yarn config set proxy http://0.0.0.0:1087
yarn config set proxy https://0.0.0.0:1087

Make sure you also set the HTTPS proxy.
确保您还设置HTTPS代理。 ( from Google Translate. Hope that is close enough to understand 😃 )

yarn config set proxy http://XX
yarn config set https-proxy http://XX

Works, Great Thanks!

如果用了 ShadowSocks NG 的代理,查看偏好设置 -> HTTP, 如下图:

image

接着在命令行如下:

yarn config set proxy http://127.0.0.1:1087
yarn config set https-proxy http://127.0.0.1:1087

Make sure you also set the HTTPS proxy.
确保您还设置HTTPS代理。 ( from Google Translate. Hope that is close enough to understand 😃 )

yarn config set proxy http://XX
yarn config set https-proxy http://XX

人才

感謝分享

這邊留言一下讓未來可以方便查詢