我正在尝试从NPM安装PhoneGap,但它在安装时失败 - 我已经将该注册表重新设置为另一篇帖子,但它仍然失败。
任何帮助都会很棒!
js@jspi ~ $ sudo npm config set registry http://registry.npmjs.org/
js@jspi ~ $ sudo npm install -g phonegap
npm http GET http://registry.npmjs.org/phonegap
npm http 200 http://registry.npmjs.org/phonegap
npm ERR! Error: No compatible version found: phonegap
npm ERR! No valid targets found.
npm ERR! Perhaps not compatible with your version of node?
npm ERR! at installTargetsError (/usr/share/npm/lib/cache.js:488:10)
npm ERR! at next_ (/usr/share/npm/lib/cache.js:438:17)
npm ERR! at next (/usr/share/npm/lib/cache.js:415:44)
npm ERR! at /usr/share/npm/lib/cache.js:408:5
npm ERR! at saved (/usr/share/npm/lib/utils/npm-registry-client/get.js:147:7)
npm ERR! at Object.oncomplete (/usr/lib/nodejs/graceful-fs.js:230:7)
npm ERR! You may report this log at:
npm ERR! <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR! reportbug --attach /home/js/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.10.25+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "phonegap"
npm ERR! cwd /home/js
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! message No compatible version found: phonegap
npm ERR! message No valid targets found.
npm ERR! message Perhaps not compatible with your version of node?
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/js/npm-debug.log
npm not ok
NPM版本 - 1.1.4 节点版本:
js@jspi ~ $ sudo nodejs --version
v0.6.19
操作系统详细信息:
js@jspi ~ $ cat /etc/*-release
PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)"
NAME="Raspbian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=raspbian
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
答案 0 :(得分:1)
如果您查看GitHub存储库中PhoneGap的package.json
文件,您会看到以下这些行:
"engines": {
"node": ">=0.10.0"
}
该行表示该程序包至少需要运行/安装Node.js版本0.10.0
。因此,要解决您的问题,请更新到最新版本的Node或至少版本0.10.0
。
答案 1 :(得分:1)
尝试通过添加-f:
强制安装sudo npm install -gf phonegap