kikukawa's diary

都内で活動するシステムエンジニアが書いてます。 興味を持った技術やハマったポイント、自分用メモをつけてます。 最近はweb中心

homebrew経由でnodebrewとnode.jsのインストール

自分用メモ

$ brew install nodebrew
==> Downloading https://github.com/hokaccha/nodebrew/archive/v0.7.4.tar.gz
######################################################################## 100.0%
==> /usr/local/Cellar/nodebrew/0.7.4/bin/nodebrew setup_dirs
==> Caveats
Add path:
  export PATH=$HOME/.nodebrew/current/bin:$PATH

To use Homebrew's directories rather than ~/.nodebrew add to your profile:
  export NODEBREW_ROOT=/usr/local/var/nodebrew

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completion has been installed to:
  /usr/local/share/zsh/site-functions
==> Summary

パスを追加するために
export PATH=$HOME/.nodebrew/current/bin:$PATH
を設定してね。

~/.nodebrewではないディレクトリを使いたいときは、
export NODEBREW_ROOT=/usr/local/var/nodebrew
をprofileに設定してね。
これを設定したら、パスの追加先も変更する必要あるような気がしますが、
今回はやってませんので、よく分かりません。

Bashzshの補完が、それぞれのパスにインストールされたよ。
ってことらしい。

インストールして、listでバージョン確認して、使用する設定をする。

$ nodebrew install stable
$ nodebrew list
$ nodebrew use v0.10.33