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
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.
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.
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With