Bower calls blocked by corporate proxy

前端 未结 16 1172
夕颜
夕颜 2020-11-30 20:00

I\'m trying to use Bower for a web app, but find myself hitting some sort of proxy issues:

D:\\>bower search jquery
bower retry         Request to https:/         


        
相关标签:
16条回答
  • 2020-11-30 20:38

    The solution for me is this config .bowerrc

    {
      "directory": "vendor",
      "registry": "http://bower.herokuapp.com",
      "proxy": "http://<user>:<pwd>@proxy.host.br:8080",
      "https-proxy": "http://<user>:<pwd>@proxy.host.br:8080",
      "strict-ssl": false
    }
    

    Using the http protocol in https-proxy plus registry entry with http protocol.

    Remember to change 8080 port number to whatever is yours proxy server port.

    0 讨论(0)
  • 2020-11-30 20:40

    its work for me to change in .bowerrc file

    {
     "directory": "client/lib", 
     "registry": "http://bower.herokuapp.com",
     "proxy":"http://192.168.1.205:3228",
     "https-proxy":"http://192.168.1.205:3228"
    }
    
    • where client/lib is installation directory where do you want to install
    • and http://192.168.1.205:3228 is your proxy ip with port. corporate proxy can be different according to oraganization.
    0 讨论(0)
  • 2020-11-30 20:43

    For info, in your .bowerrc file you can add a no-proxy attribute. I don't know since when it is supported but it works on bower 1.7.4 and it solve the issue of bower behind a corporate proxy with an internal repository

    .bowerrc :

    {
      "directory": "bower_components", 
      "proxy": "http://yourProxy:yourPort",
      "https-proxy":"http://yourProxy:yourPort",
      "no-proxy":"myserver.mydomain.com"
    }
    

    Regards

    0 讨论(0)
  • 2020-11-30 20:47

    In case it helps someone, I had a 'bower blocked by group policy' error.

    Solution was to make an exception in CryptoPrevent, a application installed on our company computers to prevent crypto lockers.

    0 讨论(0)
  • 2020-11-30 20:48

    Are you behind a proxy?

    Have you set up environment variables HTTP_PROXY and HTTPS_PROXY?

    SET HTTP_PROXY=http://yourproxyserver:yourproxyport
    SET HTTPS_PROXY=http://yourproxyserver:yourproxyport
    
    0 讨论(0)
  • 2020-11-30 20:50
    "strict-ssl": false
    

    in .bowerrc did for me

    0 讨论(0)
提交回复
热议问题