proxy配下でのyarn実行
はじめに
proxy配下でyarnを実行しようとして、速攻で躓いたのでそのまとめ。
設定確認
まずは設定情報を確認する。
yarn config list
このコマンドを実行することで、設定情報の一覧を確認することができる。
設定情報の中にproxy
もしくはhttps-proxy
の設定情報が存在するか確認する。
設定が無ければ、ここに設定を追加する。
proxy設定の追加
yarnの設定情報に対する操作はyarn configのサイトで確認できる。
設定の追加方法が確認出来たら、後は設定を追加するだけ。
// ID & Passなし yarn config set proxy http://example.com:port -g // ID & Passあり yarn config set proxy http://username:password@host:port -g
httpsの設定も必要であれば、下記の要領で設定できる。
// ID & Passなし yarn config set https-proxy http://example.com:port -g // ID & Passあり yarn config set https-proxy http://username:password@host:port -g
後はyarn add
をしてみて、installできるか確認するだけ。