在终端上安装phoneGap的问题

时间:2013-11-04 18:48:46

标签: cordova

嘿,我正在按照phoneGap的说明进行操作,并在终端

中使用以下命令
sudo npm install -g phonegap

我收到以下错误

npm ERR! registry error parsing json

npm ERR! fetch failed https://registry.npmjs.org/colors/-/colors-0.6.0-1.tgz
npm ERR! fetch failed https://registry.npmjs.org/node-static/-/node-static-0.7.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/cordova/-/cordova-3.1.0-0.1.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/phonegap-build/-/phonegap-build-0.8.4.tgz

npm ERR! network socket hang up
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/kaldenficklin
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/kaldenficklin/npm-debug.log
npm ERR! not ok code 0

我按照指示手动下载了node.js。谁能告诉我我做错了什么以及如何解决它?

2 个答案:

答案 0 :(得分:25)

如此处https://stackoverflow.com/a/13119867/1955071所述,请使用以下命令,然后安装phonegap,

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

之后,如果您收到此错误“错误:找不到兼容的版本:phonegap”然后添加强制标志来安装它,

sudo npm install -gf phonegap

答案 1 :(得分:0)

我不知道我们是否有同样的问题,但我更新了node.js和phonegap安装没有问题,试试吧!