简体   繁体   中英

Phonegap installation issue via cmd nodejs [windows 7]

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

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM