文档:
https://github.com/NetEase/pomelo/wiki
https://github.com/NetEase/pomelo/wiki/Home-in-Chinese
文档:
https://github.com/joyent/node/wiki/Installation
https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
步骤:
l 安装nodejs
# curl -sL https://deb.nodesource.com/setup | bash -
# apt-get install -y nodejs
l 检查nodejs是否安装成功
$ node –v
l 安装 pomelo
方法1:使用npm(node包管理工具)全局安装pomelo
$ npm install pomelo –g
方法2:下载源代码安装
$ git clone https://github.com/NetEase/pomelo.git
$ cd pomelo
$ npm install -g
备注:
npm文档
安装问题
安装pomelo时,提示
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.10.28"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/root/.nvm/v0.10.28/lib/node_modules/pomelo/node_modules/pomelo-rpc/node_modules/toobusy/.node-gyp"
命令换成 npm install pomelo -g --unsafe-perm 就可以成功
运行到gyp http GET http://nodejs.org/dist/v0.10.28/node-v0.10.28.tar.gz时, 整个安装过程会有点久,需耐心等待
Pomelo 命令行工具:
l 创建项目
$ pomelo init ./projectname
l 安装依赖包
$ cd projectname
$ sh npm-install.sh
l 启动game-server
$ cd game-server
$ pomelo start
l 启动web-server
$ cd web-server
$ node app
l 测试
启动浏览器,地址:
l 修改服务器IP
$ vim web-server/public/index.html
Var host = “127.0.0.1” 修改成服务器game-server的IP地址
原文地址:http://blog.csdn.net/xufeng0991/article/details/45850207