Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is a problem running the Nodejs package manager (NPM) on Windows in an network running ActiveDirectory - and the problem seems to be because I'm behind a corporate proxy.

I want NPM INSTALL to work...

We have a proxy which uses WPAD and authentication.

From the Wpad.dat I have gotten the proxy's FQDN and port (see below).

I have used

NPM CONFIG SET PROXY = http://<domain>%5C<username>:<passwordwith#>@ddcrpit311v1.corp.<company>.global:8080

to set the proxy information (with username & password) and also

NPM CONFIG SET HTTPS-PROXY = <as above>

I have set

NPM CONFIG SET registry = http://registry.npmjs.org/

so that I don't have to worry about SSL and (just in case)

NPM CONFIG SET strict-ssl = false

Still I am getting errors:

>npm install sax-js
npm http GET http://registry.npmjs.org/sax-js
npm http GET http://registry.npmjs.org/sax-js
npm http GET http://registry.npmjs.org/sax-js
npm ERR! network getaddrinfo ENOTFOUND
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settin
gs.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! System Windows_NT 5.1.2600
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "sax-js"
npm ERR! cwd C:\Documents and Settings\morsli00
npm ERR! node -v v0.10.10
npm ERR! npm -v 1.2.25
npm ERR! syscall getaddrinfo
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Documents and Settings\morsli00\npm-debug.log
npm ERR! not ok code 0

From the log the following looks important:

20 verbose url resolving [ 'http://registry.npmjs.org/', './sax-js' ]
21 verbose url resolved http://registry.npmjs.org/sax-js
22 info trying registry request attempt 1 at 16:00:20
23 http GET http://registry.npmjs.org/sax-js
24 info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND
25 info trying registry request attempt 2 at 16:00:31
26 http GET http://registry.npmjs.org/sax-js
27 info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND
28 info trying registry request attempt 3 at 16:01:31
29 http GET http://registry.npmjs.org/sax-js
30 silly lockFile 4d5ae745-sax-js sax-js@
31 silly lockFile 4d5ae745-sax-js sax-js@
32 error network getaddrinfo ENOTFOUND
32 error network This is most likely not a problem with npm itself
32 error network and is related to network connectivity.
32 error network In most cases you are behind a proxy or have bad network settings.
32 error network
32 error network If you are behind a proxy, please make sure that the
32 error network 'proxy' config is set properly.  See: 'npm help config'
33 error System Windows_NT 5.1.2600
34 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "sax-js"
35 error cwd C:\Documents and Settings\morsli00
36 error node -v v0.10.10
37 error npm -v 1.2.25
38 error syscall getaddrinfo
39 error code ENOTFOUND
40 error errno ENOTFOUND
41 verbose exit [ 1, true ]

I tried without the %5C, as well as /\ all with the same result.

I tried configuring fiddler2 to work as a reverse proxy, and I set the proxy address to localhost:8888, and configured fiddler to connect to the proxy - but then I ran into errors as well.

Is there a simple proxy program I can set up as a reverse proxy that will authenticate for me? Is there something in Node to try?

Any ideas welcome!

share|improve this question
    
I do have the same issue with me here in office. did you solved your issue? if so are you agree the answer? – 3gwebtrain May 23 '14 at 5:48

Try to add double quote to your commands :

NPM CONFIG SET PROXY = "http://<domain>%5C<username>:<passwordwith#>@ddcrpit311v1.corp.<company>.global:8080"

and :

NPM CONFIG SET HTTPS-PROXY = "http://<domain>%5C<username>:<passwordwith#>@ddcrpit311v1.corp.<company>.global:8080"

This has worked for me. ;)

share|improve this answer

This is my final and working .npmrc file

proxy=http://DOMAIN%5Cusername:password@proxyaddress:8080/ https-proxy=http://DOMAIN%5Cusername:password@proxyaddress:8080/ loglevel=verbose

share|improve this answer

Works for me in Ubuntu 16.04


npm config set proxy 'http://:'

npm config set https-proxy 'http://:'

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .