Bower calls blocked by corporate proxy

前端 未结 16 1174
夕颜
夕颜 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:56

    I am behind corporate firewall and I have to specify domain name too. None of these answers worked for me. Here is what I did -

    1. Downloaded CNTLM from http://cntlm.sourceforge.net/
    2. Obviously installed it.
    3. Open up cntml.ini and change the following

      Domain your_domain_name

      Username your_domain_username

      Password your_domain_passowrd

      PassLM 1AD35398BE6565DDB5C4EF70C0593492 (uncomment this)

      PassNT 77B9081511704EE852F94227CF48A793 (uncomment this too)

      Proxy http://localhost:8888

    4. Go to services.msc and start the CNTLM Authentication service.

    5. Download Fiddler 4/2 (whatever they call it).
    6. Install this too. This will run in http://localhost:8888
    7. Now whatever program you’re running forward(proxy) it to http://locahost:3128 ( that’s what CNTLM is running.)

    In this case specify http.proxy and https.proxy as http://localhost:8888

    This will work for other client programs. Just specify proxy as http://localhost:8888

    0 讨论(0)
  • 2020-11-30 20:57
    {
      "directory": "library",
      "registry": "http://bower.herokuapp.com",
      "proxy":"http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/",
      "https-proxy":"http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/"
    }
    

    This code worked for me. I am using Win 7 and chrome and also git bash. Here few things need to be cleared. This takes me huge time to find the actual data regarding the user name, password, proxy IP and Port. I will describe it step by step so that every learners can easily grasp the message:

    1. Create a file in the notepad named .bowerrc in the login folder; You can go there by typing at Start>Run>%UserProfile% and press OK.
    2. Type above code in the .bowerrc file with the following changes:

      Replace <USERNAME> with your internet connection user ID or login ID

      Replace <PASSWORD> with your internet connection password or login password.
      Replace <PROXY_IP> and <PROXY_PORT> with the working proxy IP address and its port number.

         **Note: There should be no angle brackets.**
      
    3. Proxy IP should be different than your own IP.

    4. Before using any proxy IP and port you should check it is working by changing your proxy IP and port.

    5. You can go through this link to know the details of proxy settings at description here

    6. From this proxy settings you will get Proxy IP and Port.
    7. Recheck all the input so that all are correct and save and close the file.
    8. Open git bash and change directory to the project file and type command and hit enter, in my case, git bash command:

    a@a-PC MINGW32 /d/conFusion

    $ bower install

    1. It worked like magic.
    0 讨论(0)
  • 2020-11-30 21:01

    Try changing the registry value in your .bowerrc:

    {
        "registry": "http://bower.herokuapp.com"
    }
    
    0 讨论(0)
  • 2020-11-30 21:01

    I did not have a .bowerrc file to configure my bower settings. I found the settings living in a file called defaults.js. found under "C:\...\bower\node_modules\bower-config\lib\util\defaults.js"
    I hope this helps others:

    var defaults = {
        'cwd': process.cwd(),
        'directory': 'bower_components',
        'registry': 'http://bower.herokuapp.com',
        'shorthand-resolver': 'git://github.com/{{owner}}/{{package}}.git',
        'tmp': paths.tmp,
        'proxy': '<<http://user:pass@proxy:port>>',  // change proxy here or at the top
        'https-proxy': '<<http://user:pass@proxy:port>>',  // change proxy here or at the top
        'timeout': 30000,
        'ca': { search: [] },
        'strict-ssl': false,
        'user-agent': userAgent,
        'color': true,
        'interactive': null,
        'storage': {
            packages: path.join(paths.cache, 'packages'),
            links: path.join(paths.data, 'links'),
            completion: path.join(paths.data, 'completion'),
            registry: path.join(paths.cache, 'registry'),
            empty: path.join(paths.data, 'empty')  // Empty dir, used in GIT_TEMPLATE_DIR among others
        }
    };
    
    module.exports = defaults;

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