0
0

More than 1 year has passed since last update.

gitやnpmのproxy設定

Posted at

初めに

社内環境で何かと問題となるため、以下のproxy設定について備忘録を残します。

gitのproxy設定

git bashを開き、以下のconfig設定を行えばよい。以降はプロキシを通した状態でもgitに接続することができる。

git-set-proxy.sh
$ git config --global http.proxy http://<username>:<userpsw>@<proxy>:<port>

npmのproxy設定

npm -g config setコマンドを使い、npmの設定をグローバルに変更する

  • proxy, https-proxyの設定を行う
    • https-proxyの設定はhttp://~で行うことに注意
  • それでもエラーになる場合、registryの設定も行う
    • CAや証明書などの設定を行う場合、httpsにする必要がある可能性あり
npm-set-proxy.sh
$ npm -g config set proxy "http://<server>:<port>/"
$ npm -g config set https-proxy "http://<server>:<port>/"
$ npm -g config set registry "http://registry.npmjs.org/"
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0