1
votes

Im trying to install phonegap using the cmd "npm install -g phonegap"

but its not installing and giving me installation failed message ive pasted the cmd message below

so how do i set the proxy settings(assuming thats the issue) which nodejs can use to connect to the internet and complete the installation of phonegap

my system config is windows 7 64bit

C:\Windows\system32>npm install -g phonegap

npm http GET https://registry.npmjs.org/phonegap

npm ERR! Error: connect ECONNREFUSED

npm ERR! at errnoException (net.js:901:11)

npm ERR! at Object.afterConnect [as oncomplete] (net.js:892:19)

npm ERR! { [Error: connect ECONNREFUSED]

npm ERR! code: 'ECONNREFUSED',

npm ERR! errno: 'ECONNREFUSED',

npm ERR! syscall: 'connect' }

npm ERR!

npm ERR! If you are behind a proxy, please make sure that the

npm ERR! 'proxy' config is set properly. See: 'npm help config'

npm ERR! System Windows_NT 6.1.7601

npm ERR! command "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nod

ejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "phonegap"

npm ERR! cwd C:\Windows\system32

npm ERR! node -v v0.10.21

npm ERR! npm -v 1.3.11

npm ERR! syscall connect

npm ERR! code ECONNREFUSED

npm ERR! errno ECONNREFUSED

npm ERR! stack Error: connect ECONNREFUSED

npm ERR! stack at errnoException (net.js:901:11)

npm ERR! stack at Object.afterConnect [as oncomplete] (net.js:892:19)

npm ERR!

npm ERR! Additional logging details can be found in:

npm ERR! C:\Windows\system32\npm-debug.log

npm ERR! not ok code 0

1
what kind of proxy are you behind? have you tried this: npm config set proxy http://server:port npm config set registry "http://registry.npmjs.org/" - NorRen
It seemed to have an issue for me because I was running it from the C:\WINDOWS\system32 folder - worked fine once I changed to a non-system folder. - Philip Murphy

1 Answers

6
votes

Solved it

Just had to set

npm config set proxy http://usr:pwd@proxyname:port

npm config set https-proxy http://usr:pwd@proxyname:port

npm config set registry http://registry.npmjs.org/