2016年5月10日火曜日

Node.js, Socket.io @ OS X 10.11

Mac OS X El Capitanでのnodebrewを利用したnode+socket.ioの環境整備についてまとめます。
ここではhomebrewは使っていませんが、基本は変わらないと思います。

1. nodebrew (0.9.5)
http://qiita.com/takeshi81/items/805f504503cd93151ca6
    まずはnodebrewをインストールします。
    デフォルトは~/.nodebrewなので気に入らない場合は
         export NODEBREW_ROOT=/usr/local/var/nodebrew
    で指定してからインストールします。

         curl -L git.io/nodebrew | perl - setup

    nodebrewへのパスを設定します。
         export PATH=/usr/local/var/nodebrew/current/bin:$PATH

    参考 https://github.com/hokaccha/nodebrew

.bash_profileを作成して、上記のパスをexportするようにしておく


2. node.js (6.1.0), nam (3.8.6)

    nodebrew install stable
    nodebrew use xxx

3. socket.io (1.4.6)

    npm install -g socket.io

/usr/local/var/nodebrew/node/v6.1.0/lib
└─┬ socket.io@1.4.6
  ├─┬ debug@2.2.0
  │ └── ms@0.7.1
  ├─┬ engine.io@1.6.9
  │ ├─┬ accepts@1.1.4
  │ │ ├─┬ mime-types@2.0.14
  │ │ │ └── mime-db@1.12.0
  │ │ └── negotiator@0.4.9
  │ ├── base64id@0.1.0
  │ ├─┬ engine.io-parser@1.2.4
  │ │ ├── after@0.8.1
  │ │ ├── arraybuffer.slice@0.0.6
  │ │ ├── base64-arraybuffer@0.1.2
  │ │ ├── blob@0.0.4
  │ │ ├── has-binary@0.1.6
  │ │ └── utf8@2.1.0
  │ └─┬ ws@1.0.1
[49m
  │   └── ultron@1.0.2
  ├─┬ has-binary@0.1.7
  │ └── isarray@0.0.1
  ├─┬ socket.io-adapter@0.4.0
  │ └─┬ socket.io-parser@2.2.2
  │   ├── debug@0.7.4
  │   └── json3@3.2.6
  ├─┬ socket.io-client@1.4.6
  │ ├── backo2@1.0.2
  │ ├── component-bind@1.0.0
  │ ├── component-emitter@1.2.0
  │ ├─┬ engine.io-client@1.6.9
  │ │ ├── component-inherit@0.0.3
  │ │ ├── has-cors@1.1.0
  │ │ ├── parsejson@0.0.1
  │ │ ├── parseqs@0.0.2
  │ │ ├── xmlhttprequest-ssl@1.5.1
  │ │ └── yeast@0.1.2
  │ ├── indexof@0.0.1
  │ ├── object-component@0.0.3
  │ ├─┬ parseuri@0.0.4
  │ │ └─┬ better-assert@1.0.2
  │ │   └── callsite@1.0.0
  │ └── to-array@0.1.4
  └─┬ socket.io-parser@2.2.6
    ├── benchmark@1.0.0
    ├── component-emitter@1.1.2
    └── json3@3.3.2

4. 設定
    httpd.confなどを修正する

5. 起動時のパスの設定方法
    http://qiita.com/hoisjp/items/19374252db8e748c3407

0 件のコメント:

コメントを投稿