A simple library that enables the proxying on HTTP requests based on a simple configuration. Example using the library. Mithgol commented Feb 20, 2012. Specifically, npm config set proxy localhost:pontnum (where portnum is the port number given in the Listen directive inside the cntlm.ini file). (I assume that you run Cntlm on the same machine where npm is run, hence localhost.).
I'm new to Node and trying to install TypeScript using the following command:
I get the following error:
I have set my proxy using the following commands:
and tried this also:
But none of them work. I am working behind a copmpany proxy with authentication, so I think this is stopping me from connecting. I have added my username and password and this also didn't work.
Does anyone have any idea how I can connect to npm whilst using the company proxy and authentication?
Thanks
5 Answers
Did you try with
where PORT can be 8080 if you don't have the proxy port?
This worked for me:npm config set proxy 'http://'username:password'@proxy.big-corp.com'
npm config set proxy http://'ninjadev:5trongP@ssw0rd'@proxy.some-bigcorp.com:PORT
This thing worked for me.
open cmd as an administrator and past the command there. modify the command with credentials provided for u.
In ubuntu-18.04 make sure that in home directory .npmrc
file contains: