Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhoneGap - Unable to install via npm, phonegap does not exist

I am trying to download and run PhoneGap. I have tried on 3 machines (2 mac, 1 windows), and I can't help but feel as though I am doing something wrong.

I have nodeJS (v0.10.13) and NPM (1.3.2) installed to the latest versions, using homebrew.

To install PhoneGap I do the following via commandline: sudo npm install -g phonegap

NPM goes on it's merry way downloading a ton of packages and installing all without warning or error.

After install I get the following, which I assume is correct:

npm http 200 https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz
/usr/local/share/npm/bin/phonegap -> /usr/local/share/npm/lib/node_modules/phonegap/bin/phonegap.js
[email protected] /usr/local/share/npm/lib/node_modules/phonegap
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
MikeBook-Pro:apps Mike$

I then restart terminal (completely quit it, cmd+q) and run phonegap, to be greeted with:

MikeBook-Pro:~ Mike$ phonegap
-bash: phonegap: command not found

I'm at my wits end here. I've installed other stuff through NPM without a problem. My /etc/paths looks like the following:

/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin

I have followed the above steps using cordova instead of phonegap, but alas; the same issue.

Any help is hugely appreciated, I just want to cry.

Edit: I'm currently trying this on OSX 10.8.2 (Mountain Lion)

like image 557
Mike Avatar asked Jul 23 '13 10:07

Mike


1 Answers

I was some how missing a few paths from my /etc/paths file. Below is that new file:

/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin

/usr/local/share
/usr/local/share/npm
/usr/local/share/npm/lib/node_modules/
/usr/local/share/npm/bin
.npm
like image 133
Mike Avatar answered Sep 28 '22 06:09

Mike