cnodejs / nodeclub

:baby_chick:Nodeclub 是使用 Node.js 和 MongoDB 开发的社区系统
http://cnodejs.org/
MIT License
9.34k stars 3.12k forks source link

colone nodeclub代码在本地运行,debugger模式启动为什么抛出log4js异常?网上都搜索不到原因 #866

Open jadeball opened 8 years ago

jadeball commented 8 years ago

colone nodeclub代码在本地运行,debugger模式启动为什么抛出log4js异常?网上都搜索不到原因。 正常模式启动,则没问题,为什么调试模式没法启动,否则怎么调试呢? @alsotang /usr/local/bin/node --debug-brk=50988 --nolazy app.js Debugger listening on port 50988 /work/Bitbucket/antdream/nodeclub/node_modules/log4js/lib/appenders/console.js:3 , consoleLog = console.log.bind(console); ^

TypeError: Cannot read property 'bind' of undefined at Object. (/work/Bitbucket/antdream/nodeclub/node_modules/log4js/lib/appenders/console.js:3:27) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (/work/Bitbucket/antdream/nodeclub/node_modules/log4js/lib/log4js.js:67:1) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (/work/Bitbucket/antdream/nodeclub/common/logger.js:6:14) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (/work/Bitbucket/antdream/nodeclub/middlewares/mongoose_log.js:2:16) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (/work/Bitbucket/antdream/nodeclub/app.js:22:1) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at [object Object].Module.runMain as _onTimeout at Timer.listOnTimeout (timers.js:92:15)

Process finished with exit code 1

jadeball commented 8 years ago

@alsotang 紧急啊 ,否则都没法调试代码了

alsotang commented 8 years ago

看起来像是 debug 模式改动了 console.log 这个函数?

我没遇到过这个问题。。不懂啊。。

2016-07-12 12:42 GMT+08:00 jadeball notifications@github.com:

@alsotang https://github.com/alsotang 紧急啊 ,否则都没法调试代码了

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cnodejs/nodeclub/issues/866#issuecomment-231935905, or mute the thread https://github.com/notifications/unsubscribe/ABGB76YKxJS5u4BPL_DHXZvU3IIZEdt4ks5qUxtSgaJpZM4JJdtQ .

jadeball commented 8 years ago

终于找到原因了。我用命令行node --debug 没问题。问题出在2014版的webstorm上。我换了2016版的webstorm则 没问题了。@alsotang