LoginSignup
4
4

More than 5 years have passed since last update.

node.jsをインストールする

Last updated at Posted at 2014-04-03

環境

  • Scientific Linux 6.5
  • Mac OSX 10.7, 10.9

前準備(Scientific Linux)

ビルドに必要なパッケージをインストールします。
飛ばして、エラーが出てきたら実行するでもいいかも。

sudo yum install gcc-c++

nodebrewを使ってnode.jsをインストール

  1. nodebrewのインストール

    curl -L git.io/nodebrew | perl - setup
    
  2. .zshenv/.zshrc/.bashrcにPATH設定を追加

    export PATH=$HOME/.nodebrew/current/bin:$PATH
    
  3. rc(もしくはenv)ファイルの再読み込み

    . ~/.zshrc
    
  4. nodeのインストール

    nodebrew install-binary v0.10.26
    
    • nodebrew help でhelpが見れます。
    • nodebrew ls-remote でインストール出来るバージョンの一覧を確認できます。
    • nodebrew install VERSION を使うとソースからビルドします。
    • nodebrew install latestで最新版をインストールすることができるのですが、node.jsはマイナーバージョンが偶数だと安定版なので、偶数を入れるのがオススメです。
  5. 使用するnodeのを指定

    nodebrew use v0.11.12
    

    ※ 指定できるバージョンはnodebrew listで確認できます。

  6. 確認

    node -v
    

参考

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4