Command to install node.js with MacPorts (Mac Package Manager).

sudo port selfupdate
sudo port install nodejs