best way to install nodejs and npm on mac code example Example 1: install node mac brew install node #Homebrew required Example 2: install npm mac brew install node