1. sudo apt-get install --yes build-essential curl git
  2. #install latest node
  3. sudo apt-get install --yes python-software-properties python g++ make
  4. sudo add-apt-repository --yes ppa:chris-lea/node.js
  5. sudo apt-get update
  6. sudo apt-get install --yes nodejs
  7. node -v
  8. sudo npm install -g phonegap

Ubuntu 12.04: How to install nodeJS and PhoneGap