Mac OS use Homebrew to install special version Nodejs

When use Sublime Text3's plugin HTML/CSS/JS Prettify need install Nodejs, use the follow to install Nodejs 6.10.0 on Mac OS via Homebrew, the default install version is 7.x

 

{ 1. Homebrew update and check }

brew update

 

{ 2. Find nodejs versions in Homebrew }

brew search node

leafnode     node         node@0.10    node@4       node@6      nodeenv
llnode       node-build   node@0.12    node@5       nodebrew     nodenv

//@4 @5 is version number

 

{ 3. install Nodejs v6 }

brew install node@6

 

{ 4. Add Path }

vi /etc/paths
add "/usr/local/opt/node@6/bin/" to the end

 

{ 5. Check nodejs and npm version }

node -v
//v6.10.0

npm -v
//3.10.10