0

So I want to debug my Phonegap webapp locally in Xcode.
I follow the step here and here, and launch in MAC CLI

$ sudo npm install -g phonegap

BUT install failed and CLI result get lots of errors with the first one is :

engine phonegap@2.9.0rc1-0.12.0: wanted: {"node":">=0.10.0"} (current: {"node":"v0.8.8","npm":"1.1.59"})

I understand my node version is too old : 0.8.8

node --version

I try to update but I am stuck with those 2 methods here and both in errors for me :

BREW
Tried Homebrew but did not work :

$ brew upgrade node  
Error: node-0.8.8 already installed

NPM
As I found here
Upgrading Node.js to latest version
How do I update Node.js?

$ sudo npm install -g n  
$ sudo n stable
sudo: n: command not found
Community
  • 1
  • 1
Miguel Bocquier
  • 2,449
  • 5
  • 22
  • 38

2 Answers2

0

In fact my bash_profile was missing the path to the n module as I found here:
cannot install npm? problems generating application

Edit your ~/.bash_profile. Add this export somewhere.

export PATH=/usr/local/bin:$PATH:/usr/local/share/npm/bin
Community
  • 1
  • 1
Miguel Bocquier
  • 2,449
  • 5
  • 22
  • 38
0

I had the same issue and fixed it by upgrading node with brew, I just run

brew install --upgrade node
mcniac
  • 854
  • 9
  • 11