Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node NPM proxy authentication - how do I configure it?

Tags:

I'm new to Node and trying to install TypeScript using the following command:

npm install -g typescript 

I get the following error:

if you are behind a proxy, please make sure that the 'proxy' config is set properly. 

I have set my proxy using the following commands:

npm config set proxy http://Username:Pa55w0rd@proxyhostname npm config set https-proxy http://Username:Pa55w0rd@proxyhostname 

and tried this also:

npm config set proxy http://"ninjadev:5trongP@ssw0rd"@proxy.some-bigcorp.com npm config set https-proxy http://"ninjadev:5trongP@ssw0rd"@proxy.some-bigcorp.com 

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

like image 969
Funky Avatar asked Oct 21 '16 08:10

Funky


People also ask

How do I set up proxy authentication?

To configure the proxy connection with a user account for authentication, add --http-proxy-user <user> or --https-proxy-user <user> . You are prompted for the proxy password. The following command is an example of enabling authentication.

How do I resolve 407 proxy authentication required npm?

Go to C:\Users\Your User\AppData\Roaming and delete the npm folder, then do the following command: npm cache clear --force and npm cache verify and then execute this command: npm i -g npm@latest --verbose . Must likely you will have to do your proxy settings again. As it will be lost be re-installing npm.


1 Answers

Did you try with

npm config set proxy http://"ninjadev:5trongP@ssw0rd"@proxy.some-bigcorp.com:PORT npm config set https-proxy http://"ninjadev:5trongP@ssw0rd"@proxy.some-bigcorp.com:PORT 

where PORT can be 8080 if you don't have the proxy port?

like image 143
robmass Avatar answered Oct 02 '22 02:10

robmass