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

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

    In my case, I forgot to set the "http://" in my config files (can be found in C: \Users \ [USERNAME] \ .npmrc) proxy adresses. So instead of having

    proxy=http://[IPADDRESS]:[PORTNUMBER]
    https-proxy=http://[IPADDRESS]:[PORTNUMBER]
    

    I had

    proxy=[IPADDRESS]:[PORTNUMBER]
    https-proxy=[IPADDRESS]:[PORTNUMBER]
    

    Which of course did not work, but the error messages didnt help much either...

提交回复
热议问题