4

I have npm installed and have used it a few times but unfortunately I had to change my proxy and I am not able to get it to work again.

here are my past settings:(the ones that worked)

npm config get proxy: http://proxy-foo.foobar.com:8080

npm config get https-proxy: http://proxy-foo.foobar.com:8080

now my proxy is a server name and when I use the proxy in my browser it works fine, but when I set the config in npm it fails with 'getaddrinfo ENOTFOUND'

current settings:

npm config get proxy: http://servername:8080

npm config get https-proxy: http://servername:8080

in my browsers proxy I do not use http:// before the server name and I think this is what is causing it to fail. could this be the problem and if so is there a way to set proxy configs in npm without using http:// before.

2
  • npm doesn't care if it has the http:// or not. What OS? Do other command-line utilities (e.g. git, wget) work OK through the proxy? Commented Feb 20, 2013 at 14:04
  • I was able to get it to work by using the FQDN instead of just the server name, and from my experience NPM does care about the http:// before Commented Feb 21, 2013 at 17:55

1 Answer 1

3

You're right; npm (more accurately, request, which actually does the fetching) does care about the http:// before the proxy name.

The proxy setting should be a fully-qualified URL that you could visit in a browser, e.g.,

http://proxy.company.com:port/

or

http://1.1.1.1:1234/

if specified as an IP address.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.