LoginSignup
2
2

More than 5 years have passed since last update.

pip, npm, gemのパッケージマネジメントでインストールするときにproxyにより通信エラーがでたときの対処

Posted at

コマンドラインからのパッケージインストール時に通信エラーがでたときの対処方法をメモしておく

Proxy設定があることによりエラーが発生しているようだったので、設定する方法を調べた。

proxyはInternet Explorerのインターネットオプション->接続->LANの設定で以下のようになっていた

(-----は伏字)

-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-

pythonのpip

コマンドに--proxy=を加える


pip install --proxy=http://proxy.------.co.jp/proxy.pac --upgrade google-api-python-client

-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-

Node.jsのnpm

npm config setでproxy及びhttps-proxyを設定する。



npm config set proxy http://proxy.-----.co.jp/proxy.pac
npm config set https-proxy http://proxy.-----.co.jp/proxy.pac

npm install googleapis --save


configで設定された内容は以下で確認できる。
npm config list

詳細は

npm config ls -l

-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-

Rubyのgem

コマンドに-pを加える


例:

gem install mechanize -r -p http://proxy.-----.co.jp/proxy.pac

-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-

2
2
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
2
2