Linux下Pomelo環境配置

來源:互聯網
上載者:User

標籤:nodejs   pomelo   


Pomelo

文檔:

https://github.com/NetEase/pomelo/wiki

https://github.com/NetEase/pomelo/wiki/Home-in-Chinese

 

 

Pomelo 安裝

文檔:

https://github.com/joyent/node/wiki/Installation

https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager

https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#debian-and-ubuntu-based-linux-distributions

 

步驟:

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文檔

https://docs.npmjs.com/

 

安裝問題

安裝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 項目

Pomelo 命令列工具:

https://github.com/NetEase/pomelo/wiki/pomelo%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8

 

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  測試

啟動瀏覽器,地址:

http://hostip:3001/

l  修改伺服器IP

$ vim web-server/public/index.html

Var host = “127.0.0.1” 修改成伺服器game-server的IP地址

Linux下Pomelo環境配置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.