Phone gap installtion with Node Js

Post date: Feb 28, 2014 1:25:30 PM

Phonegap

Now I got opportunity to learn about phonegap with Node js. Project has been kick started and I start exploring on phone gap.

Actually this is first time I’m using phone gap, So I prepared myself to install phoegap 

http://phonegap.com/install/ 

Execute below command to install the phone gap.

$ sudo npm install -g phonegap

as usual it throws 

sudo: npm: command not found 

It is clear that I’ve not installed node js, so download node js on below url

http://nodejs.org/

After install this I’ve tried the same command, but the problem is not gets solved. Again it showed the same error.

I restarted the machine twice (you're thinking i'm stupid, do you? ), but no luck. 

I decided to look at the $PATH, it’s looking pretty much OK, then I open terminal and executed below command

$ sudo cd /usr/local/bin

But terminal shows I was in local directory, finally I came to know that I don’t have enough permission to visit bin.Finally the solution is

$sudo chmod -R 777 /usr/local/bin

Now the problem is gets solved. I start using the those commands without any issues.