Q:

Npm express module not installing

I am trying to install express module of Node JS using command prompt, but getting  error everytime.  I have tried the following solutions from similar posts elsewhere, but to no help. 
1.  Run cmd in administrator mode. 
2.  Check internet issues.  
The command i am using is 
npm install -g express-generator

I have also tried gd instead of g. 
The error file contents are
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',

1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'express-generator' ]
2 info using npm@3.6.0
3 info using node@v5.7.1
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData express-generator
8 silly fetchNamedPackageData express-generator
9 silly mapToRegistry name express-generator
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry https://registry.npmjs.org/
12 silly mapToRegistry uri https://registry.npmjs.org/express-generator
13 verbose request uri https://registry.npmjs.org/express-generator
14 verbose request no auth needed
15 info attempt registry request try #1 at 2:21:17 PM
 16 verbose request id b26b9ae72d812cde
17 http request GET https://registry.npmjs.org/express-generator
18 info retry will retry, error on last attempt: Error: getaddrinfo EAI_AGAIN registry.npmjs.org:443

19 info attempt registry request try #2 at 2:21:27 PM
20 http request GET https://registry.npmjs.org/express-generator
21 info retry will retry, error on last attempt: Error: getaddrinfo EAI_AGAIN registry.npmjs.org:443

22 info attempt registry request try #3 at 2:22:27 PM
23 http request GET https://registry.npmjs.org/express-generator
24 silly fetchPackageMetaData Error: getaddrinfo EAI_AGAIN registry.npmjs.org:443

24 silly fetchPackageMetaData     at Object.exports._errnoException (util.js:856:11)

24 silly fetchPackageMetaData     at errnoException (dns.js:31:15)
24 silly fetchPackageMetaData     at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)

24 silly fetchPackageMetaData  error for express-generator { [Error: getaddrinfo EAI_AGAIN registry.npmjs.org:443]
24 silly fetchPackageMetaData   code: 'EAI_AGAIN',
24 silly fetchPackageMetaData   errno: 'EAI_AGAIN',
24 silly fetchPackageMetaData   syscall: 'getaddrinfo',
24 silly fetchPackageMetaData   hostname: 'registry.npmjs.org',
24 silly fetchPackageMetaData   host: 'registry.npmjs.org',
24 silly fetchPackageMetaData   port: 443 }
25 silly rollbackFailedOptional Starting
26 silly rollbackFailedOptional Finishing
27 silly runTopLevelLifecycles Starting
28 silly runTopLevelLifecycles Finishing
29 silly install printInstalled
30 verbose stack Error: getaddrinfo EAI_AGAIN registry.npmjs.org:443
30 verbose stack     at Object.exports._errnoException (util.js:856:11)
30 verbose stack     at errnoException (dns.js:31:15)
30 verbose stack     at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)

31 verbose cwd C:\Users\rachit.gupta09\NodejsApp
32 error Windows_NT 6.3.9600
33 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "express-generator"

34 error node v5.7.1
35 error npm  v3.6.0
36 error code EAI_AGAIN
37 error errno EAI_AGAIN
38 error syscall getaddrinfo
39 error getaddrinfo EAI_AGAIN registry.npmjs.org:443
40 error If you need help, you may report this error at:
40 error     <https://github.com/npm/npm/issues>
41 verbose exit [ 1, true ]

The directory where i am running this command contains my js file.  Any help is appreciated.  Thanks

A:

As mentioned in the comments, you're using a proxy to connect to the internet - NPM by default won't know anything about this, so you'll need to change its global configuration settings. 
npm config set proxy http://[Host]:[Port]
npm config set https-proxy http://[Host]:[Port]

