[Mac] Node.js と npm をインストールする方法 [Homebrew]
Macに Node.js と npm をインストールする方法を調べたのでメモ。
node.js を homebrew でインストールする
$ brew install node |
正常にインストールされたことを確認します。
$ node -v v0.4.11 |
npm を homebrew でインストールできない…
Homebrew の npm formula は、収録のポリシーに沿わない( https://github.com/mxcl/homebrew/wiki/Acceptable-Formula )として最近、取り除かれたそうです。
メッセージにあるように curl http://npmjs.org/install.sh | sh でインストールすべきみたいです。
$ brew install npm Error: No available formula for npm npm can be installed thusly by following the instructions at http://npmjs.org/ To do it in one line, use this command: curl http://npmjs.org/install.sh | sh |
npm を curl経由でインストールする
$ curl http://npmjs.org/install.sh | sh |
正常にインストールされたことを確認します。
$ npm -v 1.0.103 |
以上です。
参考情報
・node.jsとnpmのインストール – 自分の感受性くらい
・MacOSXでnode.js/npm/nvmをインストール – tagomorisのメモ置き場