LoginSignup
107
111

More than 5 years have passed since last update.

node.jsの管理をhomebrewからnodebrewに変えて、npmをインストール

Last updated at Posted at 2013-04-05

しばらくnode.jsの環境をほったらかしにしていたらnodebrewなるものが便利とのことなので、復習がてら環境を作りなおしてみる。

[hokaccha / nodebrew]

homebrewでインストールしたnode.jsのアンインストール

先にnpmをアンインストール

$ cd /usr/local/lib
$ sudo npm uninstall npm
$ rm -rf /usr/local/bin/npm

node.jsをhomebrewからアンインストール

$ sudo brew uninstall node.js

nodebrewをインストール

ワンライナー

$ curl https://raw.github.com/hokaccha/nodebrew/master/nodebrew | perl - setup

PATH通すために.zshrcに追記
v0.8系の最新が使いたいので。

if [[ -f ~/.nodebrew/nodebrew ]]; then
    export PATH=$HOME/.nodebrew/current/bin:$PATH
    nodebrew use v0.8
fi

node.jsのインストール

ソースからインストール(時間かかる)

$ nodebrew install v0.8

バイナリからインストール(早い!!)

$ nodebrew install-binary v0.8

インストール確認とバージョン

$ nodebrew use v0.8
$ node -v
v0.8.22

npmのインストール

$ npm -v
1.2.14

勝手に入ってた

CoffeeScriptもインストール

$ npm install -g coffee-script

ほい

$ coffee -v
CoffeeScript version 1.6.2
107
111
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
107
111