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

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

    I tried all of these options, but my proxy wasn't having any of it for some reason. Then, born out of desparation/despair, I randomly tried curl in my Git Bash shell, and it worked.

    Unsetting all of the proxy options using

    npm config rm proxy
    npm config rm https-proxy
    

    And then running npm install in my Git Bash shell worked perfectly. I don't know how it's set up correctly for the proxy and the Windows cmd prompt isn't, but it worked.

提交回复
热议问题