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

前端 未结 29 1308
隐瞒了意图╮
隐瞒了意图╮ 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:17

    Setup npm proxy

    For HTTP:

    npm config set proxy http://proxy_host:port
    

    For HTTPS:

    use the https proxy address if there is one

    npm config set https-proxy https://proxy.company.com:8080
    

    else reuse the http proxy address

    npm config set https-proxy http://proxy.company.com:8080
    

    Note: The https-proxy doesn't have https as the protocol, but http.

提交回复
热议问题