Tag Archives: npm

Installing Cordova when under a Proxy

I have been installing cordova on my work machine this passed days and I am really not happy when it failed because it can’t connect to the internet because our proxy is using AD Authentication. I have tried some NTLM proxy but its not working anymore. My alternative was to connect to the internet directly which is something that will work only when I am at home. Thank fully I found a working way to make it happen with a help from github gist.

Here is the modified steps:

  1. Install CNTLM(mirror) in a folder where you have full rights to run it as administrator.
  2. Open cntlm.ini and fill it :Username YOUR_USERNAME
    Domain YOUR_DOMAIN
    Proxy YOUR_PROXY_IP:PORT
    Password YOUR_PASSWORD
    Listen 53128
  3.  Run the CNTLM by running this command on the context of the folder on Step #1
    cntlm -v -f -c "cntlm.ini"
  4. Run the following on your NPM commands on your Node.js window
    npm config set proxy http://localhost:53128
    npm config set https-proxy http://localhost:53128
    npm config set registry http://registry.npmjs.org
  5. Now you can install Cordova without any issue and even install other NPM modules.

Just a CAUTION your password is in plain text. So be reminded to remove it when your working on a multi-developer machine.

God Bless!