Kalo di googling sebenernya ada banyak cara menginstall NodeJS, karena kebetulan saya menggunakan mac, maka di post ini saya coba untuk sharing cara menginstall NodeJS menggunakan Homebrew (as a package manager) dan NVM (to manage multiple node version).

Installing Homebrew

/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

Install Command Line Tools

xcode-select –install

Add these line into .bash_profile

export NVM_DIR=”$HOME/.nvm”
. “$(brew –prefix nvm)/nvm.sh”

Install NVM

brew install NVM

Install Node

nvm install nodeĀ 

List installed nodeJSĀ 

nvm list

Switch node version

nvm use <node version>