プロダクト開発日誌

技術のことなど

nodebrew を利用してnode.jsをinstallする

nodebrewは、node.jsを自分のマシン内でversion管理するためのtool。rubyのrbenvのようなもの。

github.com

ソースを持ってくる

$ curl -L git.io/nodebrew | perl - setup

パスを追加.bashrc .zshrc などに

# nodebrew
export PATH=$HOME/.nodebrew/current/bin:$PATH

環境変数の読み込み

$ source ~/.zshrc

install可能なnode.jsのバーションの一覧

$ nodebrew ls-remote

nodebrewでnode.jsのinstall

$ nodebrew install v8.11.3

使用するバージョンを指定

$ nodebrew use v8.11.3
$ rehash

バージョン確認

$ node -v
v8.11.3