Is there a way to make npm install (the command) to work behind proxy?

前端 未结 29 1315
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 08:08

Read about a proxy variable in a .npmrc file but it does not work. Trying to avoid manually downloading all require packages and installing.

29条回答
  •  一个人的身影
    2020-11-22 08:32

    To setup the http proxy have the -g flag set:

    sudo npm config set proxy http://proxy_host:port -g

    For https proxy, again make sure the -g flag is set:

    sudo npm config set https-proxy http://proxy_host:port -g

提交回复
热议问题