使用npm安装phonegap 3.0 CLI时出错

时间:2013-11-05 07:47:53

标签: cordova command-line-interface npm

尝试使用cli安装phonegap 3.0时出现以下错误 你能帮我弄清楚我哪里出错吗? 我使用的是Macbook Pro

~ developer$ sudo npm install g- phonegap
npm http GET https: //registry.npmjs.org/g-
npm http GET https: //registry.npmjs.org/phonegap
npm http GET https: //registry.npmjs.org/g-
npm http GET https: //registry.npmjs.org/phonegap
npm http GET https: //registry.npmjs.org/g-
npm http GET https: //registry.npmjs.org/phonegap
npm ERR! network tunneling socket could not be established, cause=connect ECONNREFUSED
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 settings.
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 Darwin 13.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "g-" "phonegap"
npm ERR! cwd /Users/developer
npm ERR! node -v v0.10.21
npm ERR! npm -v 1.3.11
npm ERR! code ECONNRESET
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/developer/npm-debug.log
npm ERR! not ok code 0

2 个答案:

答案 0 :(得分:0)

这是因为您的代理设置不正确。也许您从代理服务器后面使用npm,因此您需要更新npm的代理设置。为此,您可以点击http://wil.boayue.com/blog/2013/06/14/using-npm-behind-a-proxy/链接。希望这有帮助

答案 1 :(得分:0)

这可能不是唯一的问题,但

sudo npm install g- phonegap

应该是

sudo npm install -g phonegap