yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry

Home Page:https://classic.yarnpkg.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

yuanyuanshen opened this issue · 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

人才

commented

感謝分享

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