Installing node on Mac require brew (Homebrew). If you have not installed it, you can follow Brew installation guide. Here are the steps to install node on Mac on command line.
$ brew install node
In case you need to upgrade already installed node
$ brew upgrade node
Print info about installed package
List installed files
$ brew list -v node
Check the installation
$ node --version v5.5.0 $ npm --version 3.5.3
Self update npm to latest version as npm installed along with node may not be latest.
$ npm update -g npm