node.js 環境構築備忘録(まっさらMacOS Sierra)

homebrewインストール

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

nodebrewインストール

$ brew install nodebrew
$ nodebrew setup

PATHを通す

$ echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bash_profile
$ source ~/.bash_profile

nodeインストール

$ nodebrew install-binary latest
$ node -v
-bash: node: command not found(使用するバージョンが設定されてないので)
$ nodebrew list
v7.4.0
$ nodebrew use v7.4.0
$ node -v
v7.4.0