Several applications (eg. phonegap) require that you have an installation of node.js and/or npm on your machine.
On Mac OS X a very useful tool is homebrew in order to be able to install packages, speaking of which the easiest way for installaing node.js and npm is:
brew install node OR brew install npm
In fact they are installed together so if you try to install one of the two the other one will be installed as well.