pomelo icon indicating copy to clipboard operation
pomelo copied to clipboard

version 3.4 Cannot find module 'file'"

Open NewYuil opened this issue 13 years ago • 16 comments

liutekiMacBook-Pro:game-server liu$ ./node_modules/pomelo/bin/pomelo start

/Users/liu/work/cocosfamily/cc221/chat/game-server/node_modules/pomelo/node_modules/pomelo-logger/node_modules/log4js/lib/log4js.js:205

        throw new Error("Problem reading log4js config " + util.inspect(co
              ^

Error: Problem reading log4js config { appenders: [ { type: 'file', filename: './logs/node-log-master-server-1.log', fileSize: 1048576, layout: [Object], backups: 5 }, { type: 'console' }, { type: 'file', filename: './logs/rpc-log-master-server-1.log', fileSize: 1048576, layout: [Object], backups: 5, category: 'rpc-log' }, { type: 'file', filename: './logs/forward-log-master-server-1.log', fileSize: 1048576, layout: [Object], backups: 5, category: 'forward-log' }, { type: 'file', filename: './logs/crash.log', fileSize: 1048576, layout: [Object], backups: 5, category: 'crash-log' } ], levels: { 'rpc-log': 'ERROR', 'forward-log': 'ERROR' }, replaceConsole: true }. Error was "Cannot find module 'file'" (Error: Cannot find module 'file' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:362:17) at require (module.js:378:17) at loadAppender (/Users/liu/work/cocosfamily/cc221/chat/game-server/node_modules/pomelo/node_modules/pomelo-logger/node_modules/log4js/lib/log4js.js:290:26) at /Users/liu/work/cocosfamily/cc221/chat/game-server/node_modules/pomelo/node_modules/pomelo-logger/node_modules/log4js/lib/log4js.js:145:13 at Array.forEach (native) at configureAppenders (/Users/liu/work/cocosfamily/cc221/chat/game-server/node_modules/pomelo/node_modules/pomelo-logger/node_modules/log4js/lib/log4js.js:144:22) at configureOnceOff (/Users/liu/work/cocosfamily/cc221/chat/game-server/node_modules/pomelo/node_modules/pomelo-logger/node_modules/log4js/lib/log4js.js:196:13) at Object.configure (/Users/liu/work/cocosfamily/cc221/chat/game-server/node_modules/pomelo/node_modules/pomelo-logger/node_modules/log4js/lib/log4js.js:256:5)) at configureOnceOff (/Users/liu/work/cocosfamily/cc221/chat/game-server/node_modules/pomelo/node_modules/pomelo-logger/node_modules/log4js/lib/log4js.js:205:19) at Object.configure (/Users/liu/work/cocosfamily/cc221/chat/game-server/node_modules/pomelo/node_modules/pomelo-logger/node_modules/log4js/lib/log4js.js:256:5) at Object.configure (/Users/liu/work/cocosfamily/cc221/chat/game-server/node_modules/pomelo/node_modules/pomelo-logger/lib/logger.js:46:9) at Object.module.exports.configure (/Users/liu/work/cocosfamily/cc221/chat/game-server/node_modules/pomelo/lib/util/log.js:9:10) at configLogger (/Users/liu/work/cocosfamily/cc221/chat/game-server/node_modules/pomelo/lib/util/appUtil.js:153:9) at Object.module.exports.defaultConfiguration (/Users/liu/work/cocosfamily/cc221/chat/game-server/node_modules/pomelo/lib/util/appUtil.js:14:3) at Object.Application.init (/Users/liu/work/cocosfamily/cc221/chat/game-server/node_modules/pomelo/lib/application.js:55:11) at Object.Pomelo.createApp (/Users/liu/work/cocosfamily/cc221/chat/game-server/node_modules/pomelo/lib/pomelo.js:67:7) at Object. (/Users/liu/work/cocosfamily/cc221/chat/game-server/app.js:6:18) at Module._compile (module.js:449:26)

NewYuil avatar Mar 20 '13 07:03 NewYuil

Maybe you should try to install pomelo -g and use global pomelo command to start the application.

py8765 avatar Mar 20 '13 08:03 py8765

同centos 6上的错误一样,是用pomelo -g 安装的

lyls avatar Mar 20 '13 08:03 lyls

试试我的方法,把log4js退到0.5.7版本

lyls avatar Mar 20 '13 08:03 lyls

log4js现在更新到了0.6.0 可能是这个原因,改成旧版本就能运行了。 找到将pomelo-logger里面的package.json中的"log4js": ">=0.5.3"改成"log4js": "=0.5.7",删除pomelo-logger里面的node_modules,在pomelo-logger目录下重新npm install -d

kid2682 avatar Mar 20 '13 09:03 kid2682

我按上面的方法改了版本确实可以,但是现在又有个问题,gameserver链接不上

a289459798 avatar Mar 20 '13 13:03 a289459798

im having the same issue. Any idea how to fix this? I dont understand mandarin.

bump:still not able to start the server because of this issue on osx 10.6.8

mu1ex avatar Mar 21 '13 13:03 mu1ex

ok fixed it.. If anyone has the above issue then do the following:

go to the following directory

yourapp/game-server/node_modules/pomelo/node_modules/pomelo-logger

open package.json and change the version of log4js to 0.5.7 so it should look like "log4js": "=0.5.7"

then save the file and finally run the command

npm install -d

Thats it now your server should start

mu1ex avatar Mar 21 '13 14:03 mu1ex

thinks

NewYuil avatar Mar 22 '13 11:03 NewYuil

不行啊,还是有新问题。。。


E:\Test\helloworld\game-server>pomelo start [2013-03-23 21:19:25.722] [INFO] \node_modules\pomelo\lib\application.js - application inited: "master-server-1" [2013-03-23 21:19:25.722] [INFO] \node_modules\pomelo\lib\application.js - application inited: "master-server-1"

'C:\Program' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 [2013-03-23 21:19:25.918] [INFO] console - info: 'socket.io started' [2013-03-23 21:19:25.919] [INFO] \node_modules\pomelo\lib\master\starter.js - Executing cd E:\Test\helloworld\game-server && C:\Program Files\nodejs\node.exe E:\Test\helloworld\game-server\app.js env=development id=connector-server-1 host=127.0.0.1 port=3150 clientPort=3010 frontend=true serverType=connector locally [2013-03-23 21:19:25.918] [INFO] console - info: 'socket.io started'

[2013-03-23 21:19:25.919] [INFO] \node_modules\pomelo\lib\master\starter.js - Executing cd E:\Test\helloworld\game-server && C:\Program Files\nodejs\node.exe E:\Test\helloworld\game-server\app.js env=development id=connector-server-1 host=127.0.0.1 port=3150 clientPort=3010 frontend=true serverType=connector locally

[2013-03-23 21:19:26.066] [INFO] \node_modules\pomelo\node_modules\pomelo-admin\lib\consoleService.js - try to connect master: "master", "127.0.0.1", 3005 [2013-03-23 21:19:26.066] [INFO] \node_modules\pomelo\node_modules\pomelo-admin\lib\consoleService.js - try to connect master: "master", "127.0.0.1", 3005

[2013-03-23 21:19:26.083] [ERROR] console - FAILED TO RUN, return code: 1 [2013-03-23 21:19:26.083] [ERROR] console - FAILED TO RUN, return code: 1

[2013-03-23 21:19:26.084] [INFO] console - 'C:\Program' 锟斤拷锟斤拷锟节诧拷锟斤拷锟解部锟斤拷锟筋,也锟斤拷锟角匡拷锟斤拷锟叫的筹拷锟斤拷 锟斤拷锟斤拷锟斤拷锟斤拷锟侥硷拷锟斤拷

[2013-03-23 21:19:26.084] [INFO] console - 'C:\Program' �����ڲ����ⲿ���Ҳ���ǿ����еij��� ���������ļ���

[2013-03-23 21:19:26.333] [INFO] \node_modules\pomelo\lib\application.js - "master-server-1" enter after start... [2013-03-23 21:19:26.333] [INFO] \node_modules\pomelo\lib\application.js - [2013-03-23 21:19:26.334] [INFO] \node_modules\pomelo\lib\application.js - "master-server-1" finish start "master-server-1" enter after start...

[2013-03-23 21:19:26.334] [INFO] \node_modules\pomelo\lib\application.js - "master-server-1" finish start

strivingzhou avatar Mar 23 '13 13:03 strivingzhou

Your server is running fine.. You can check the status of the running server by opening a new command prompt. Then cd to the directory where your server is. Then type the command pomelo list That will list the status of the server.

EDIT: Please post your issues in english please. Most of us cant understand mandarin.

mu1ex avatar Mar 23 '13 14:03 mu1ex

there just has the master-sever, the connect-server cann't be started..


E:\Test\helloworld\game-server>pomelo list serverId serverType pid heapUsed(M) uptime(m) master-server-1 master 3860 13.97 0.24

strivingzhou avatar Mar 23 '13 15:03 strivingzhou

i solve the problem by flowing two steps: 1.chanage the game-server package.json "pomelo" dependencies from 0.3.4 to 0.3.3 2.change the game-server\node_modules\pomelo\node_modules\pomelo-logger package.json "log4js" from ">=0.5.3" to "0.5.7";

strivingzhou avatar Mar 23 '13 16:03 strivingzhou

你这个问题是用空格的问题,你可以参考这里 https://github.com/NetEase/pomelo/commit/4877ef4ca48abb833a190101597c384ccfac7482

a289459798 avatar Mar 24 '13 08:03 a289459798

解决了window下面路径有空格的问题,现在又有新问题了

Error: No such module at process.startup.processSignalHandlers.process.on.process.addListener (nod e.js:480:27) at Object. (E:\nodejs\test\game-server\node_modules\pomelo\node_m odules\pomelo-rpc\lib\rpc-server\acceptors\tcp-acceptor.js:164:9) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:362:17) at require (module.js:378:17) at Object. (E:\nodejs\test\game-server\node_modules\pomelo\node_m odules\pomelo-rpc\lib\rpc-server\server.js:55:30) at Module._compile (module.js:449:26)

a289459798 avatar Mar 24 '13 09:03 a289459798

@a289459798 Which version of node you are using? It seems fail on binding the system signal.

changchang avatar Mar 25 '13 03:03 changchang

Thank you jp2002, "log4js": "=0.5.7" works!

GeekXu avatar Apr 07 '13 03:04 GeekXu