Skip to content
This repository

在Treasures例子中启动game-server时报错 #152

Closed
peiweippww opened this Issue · 4 comments

5 participants

peiweippww Johnny Wong strivingzhou Charlie Crane
peiweippww

错误如下:
/treasures/game-server/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 (/data/work/peiwei/treasures/game-server/node_modules/pomelo-logger/node_modules/log4js/lib/log4js.js:290:26)
at /data/work/peiwei/treasures/game-server/node_modules/pomelo-logger/node_modules/log4js/lib/log4js.js:145:13
at Array.forEach (native)
at configureAppenders (/data/work/peiwei/
treasures/game-server/node_modules/pomelo-logger/node_modules/log4js/lib/log4js.js:144:22)
at configureOnceOff (/data/work/peiwei/treasures/game-server/node_modules/pomelo-logger/node_modules/log4js/lib/log4js.js:196:13)
at Object.configure (/data/work/peiwei/treasures/game-server/node_modules/pomelo-logger/node_modules/log4js/lib/log4js.js:256:5))
at configureOnceOff (/data/work/peiwei/treasures/game-server/node_modules/pomelo-logger/node_modules/log4js/lib/log4js.js:205:19)
at Object.configure (/data/work/peiwei/treasures/game-server/node_modules/pomelo-logger/node_modules/
log4js/lib/log4js.js:256:5)
at Object.configure (/data/work/peiwei/treasures/game-server/node_modules/pomelo-logger/lib/logger.js:46:9)
at Object.module.exports.configure (/data/work/peiwei/treasures/game-server/node_modules/pomelo/lib/util/log.js:9:10)
at configLogger (/data/work/peiwei/treasures/game-server/node_modules/pomelo/lib/util/appUtil.js:153:9)
at Object.module.exports.defaultConfiguration (/data/work/peiwei/treasures/game-server/node_modules/pomelo/lib/util/appUtil.js:14:3)
at Object.Application.init (/data/work/peiwei/treasures/game-server/node_modules/pomelo
/lib/application.js:55:11)
at Object.Pomelo.createApp (/data/work/peiwei/treasures/game-server/node_modules/pomelo/lib/pomelo.js:67:7)
at Object. (/data/work/peiwei/treasures/game-server/app.js:8:18)
at Module._compile (module.js:449:26)

Johnny Wong

在 game-server 目录下建立一个 logs 文件夹 试试

peiweippww

不行的,我重新安装了下pomelo,然后init下,在game-server下pomelo start也是报这个错,在game-server下有logs文件夹

strivingzhou

请问解决了嘛?我的也报这个错!!!有logs文件夹的

ETiV commented
cd /treasures/game-server/node_modules/pomelo-logger/
vim package.json

    // 找到 "log4js":, 冒号后面双引号里的改成 0.5.7
    "log4js":"0.5.7"
    // :wq

npm install -d

cd /treasures/game-server/
pomelo start
Charlie Crane xiecc closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.