我正在尝试从 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 Node 版本:
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"
最佳答案
如果你看一下 package.json
在 GitHub 存储库中的 PhoneGap 文件中,您将看到以下几行:
"engines": {
"node": ">=0.10.0"
}
该行表示该包至少需要 Node.js 版本 0.10.0
才能运行/安装。因此,要解决您的问题,请更新到最新版本的 Node 或至少版本 0.10.0
。
关于node.js - 从 NPM 安装 PhoneGap 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21338546/