プライベートプロジェクトでも React を利用しようと思い立つ。
見てみると node が入っていなかった。
$ npm bash: npm: command not found
まずは node をインストールします。
nodebrew のインストール
curl -L git.io/nodebrew | perl - setup
でインストール。
$ curl -L git.io/nodebrew | perl - setup % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0 100 23761 100 23761 0 0 9004 0 0:00:02 0:00:02 --:--:-- 682k Fetching nodebrew... Installed nodebrew in $HOME/.nodebrew ======================================== Export a path to nodebrew: export PATH=$HOME/.nodebrew/current/bin:$PATH ========================================
0.8.1
がインストールされた模様。
~/prj/gp-web$ nodebrew nodebrew 0.8.1 Usage: nodebrew help Show this message : :
node のインストール
nodebrew install-binary stable
でインストール
$ nodebrew install-binary stable fetch: http://nodejs.org/dist/v5.2.0/node-v5.2.0-darwin-x64.tar.gz #################################################################################################################################################### 100.0% Install successful
v5.2.0
が インストールされたもよう
~/prj/gp-web$ nodebrew list v5.2.0
v5.2.0 を指定する。
$ nodebrew use v5.2.0 use v5.2.0
npm
と叩くと動いている模様。
最後の方文字化けしとるね。
$ npm Usage: npm <command> where <command> is one of: : : : npm@3.3.12 /Users/foolsgold/.nodebrew/node/v5.2.0/lib/node_modules/npm [?25h[0G[?25h[0G~$
文字化けを修正
http://cortyuming.hateblo.jp/entry/20120818/p3 を参照しexport NODE_NO_READLINE=1
を入れるも文字化け解消されず。
放置に決定。
おわり
バージョンとか気にしなくて良いのかな。
まぁ、調べろって事だろうが。。。うへぇ
入門 React ―コンポーネントベースのWebフロントエンド開発
- 作者: Frankie Bagnardi,Jonathan Beebe,Richard Feldman,Tom Hallett,Simon HØjberg,Karl Mikkelsen,宮崎空
- 出版社/メーカー: オライリージャパン
- 発売日: 2015/04/03
- メディア: 大型本
- この商品を含むブログ (2件) を見る