LoginSignup
253
256

More than 3 years have passed since last update.

[Node.js] npm の proxy と registry 設定

Last updated at Posted at 2014-07-10

npm の proxy と registry 設定

社内環境で、いつも問題になるので覚え書き。

proxy と https-proxy だけでだめなら registry を設定している。

※以下、プロキシサーバを http://proxyserver:8080 と記述している。

$ npm -g config set proxy http://proxyserver:8080
$ npm -g config set https-proxy http://proxyserver:8080
$ npm -g config set registry http://registry.npmjs.org/
$ npm config list

Linux では proxy と https-proxy の設定だけで問題は起きていない。
Windows では registry も https から http に変更しないと動かない。

Windows では以下の様なBAT/CMDスクリプトファイルを用意すると良い。

call npm -g config set proxy http://proxyserver:8080
call npm -g config set https-proxy http://proxyserver:8080
call npm -g config set registry http://registry.npmjs.org/
call npm config list
pause
253
256
3

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
253
256