J Spring
J Spring

Reputation: 492

Installing PhoneGap from NPM Fails

I am trying to install PhoneGap from NPM, but it is failing on install - I have set the registry again as another post suggested but it still fails.

Any help would be great!

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 Version - 1.1.4 Node Version:

js@jspi ~ $ sudo nodejs --version
v0.6.19

OS Details:

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"

Upvotes: 3

Views: 2080

Answers (2)

Naili
Naili

Reputation: 1602

Try to force the install by adding -f :

sudo npm install -gf phonegap

Upvotes: 1

hexacyanide
hexacyanide

Reputation: 91619

If you take a look at the package.json file of PhoneGap on the GitHub repository, you'll see these lines:

"engines": {
  "node": ">=0.10.0"
}

The line means that the package requires at least Node.js version 0.10.0 to run/install. Therefore, to fix your problem, update to the latest version of Node or at least version 0.10.0.

Upvotes: 1

Related Questions