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

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

    Though there are already many good advice, for my environment(Windows 7, using PowerShell) and the last version available of node.js ( v8.1.2 ) all the above did not worked, except when I followed brunowego settings.

    So check your settings with :

    npm config list
    

    Settings behind a proxy:

    npm config set registry http://registry.npmjs.org/
    npm config set http-proxy http://username:password@ip:port
    npm config set https-proxy http://username:password@ip:port
    npm config set proxy http://username:password@ip:port
    npm set strict-ssl false
    

    Hope this will save time to someone

提交回复
热议问题