第一步:安装node
>git clone https://github.com/joyent/node.git
>cd node
>git checkout v0.10.33-release
>./configure
>make
>make install
第二步:安装npm
mac下使用命令ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
第三步:安装redis
>wget http://download.redis.io/releases/redis-2.8.17.tar.gz
tar xzf redis-2.8.17.tar.gz
>cd redis-2.8.17
>make
启动redis服务
>src/redis-server
第四步:创建package.json
>cd /data/maturi/current/
>npm init
>name: (20141201051425) chat-server
>version: (1.0.0)
>description: chat nodejs socket.io
>entry point: (chat_server.js)
>test command: chat-server
>git repository: (https://github.com/monstar-lab/maturi.git)
>keywords: chat nodejs socket.io
>author: maturi
>license: (ISC)
第五步:
>npm install redis --save
>npm install socket.io --save
>npm install socket.io-redis —save
->npm install mysql —save
git clone https://github.com/joyent/node.git
cd node
git checkout v0.10.33-release #Try checking nodejs.org for what the stable version is
./configure && make && sudo make install
npm
wget http://download.redis.io/releases/redis-2.8.17.tar.gz
$ tar xzf redis-2.8.17.tar.gz
$ cd redis-2.8.17
$ make
$ src/redis-server
sudo redis-cli -h localhost shutdown
cd /data/maturi/current/
npm init
>name: (20141201051425) chat-server
>version: (1.0.0)
>description: chat nodejs socket.io
>entry point: (chat_server.js)
>test command: chat-server
>git repository: (https://github.com/monstar-lab/maturi.git)
>keywords: chat nodejs socket.io
>author: maturi
>license: (ISC)
npm install redis —save
npm install socket.io —save
npm install socket.io-redis —save
npm install fs -save