0

我在尝试使用 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
4

2 回答 2

0

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

sudo npm install g- phonegap

应该

sudo npm install -g phonegap
于 2014-02-24T02:03:37.043 回答
0

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

于 2014-01-28T20:09:31.030 回答