xiongwilee / Gracejs

A Nodejs BFF framework, build with koa2(基于koa2的标准前后端分离框架)
https://grace.wilee.me
MIT License
1.39k stars 238 forks source link

webstrom run || debug 模式跑不起来 #10

Closed ipetu closed 8 years ago

ipetu commented 8 years ago

/Users/liu/Desktop/CssLearn/nodejs/koa-grace/src/app.js:54 config.csrf.module.indexOf(appName) > -1 && vapp.use(csrf(vapp, { ^

TypeError: Cannot read property 'module' of undefined at app.use.vhosts.map (/Users/liu/Desktop/CssLearn/nodejs/koa-grace/src/app.js:54:14) at Array.map (native) at Object. (/Users/liu/Desktop/CssLearn/nodejs/koa-grace/src/app.js:47:22) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at require (internal/module.js:20:19) at Object. (/Users/liu/Desktop/CssLearn/nodejs/koa-grace/bin/server.js:13:13) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Module.runMain (module.js:590:10) at run (bootstrap_node.js:394:7) at startup (bootstrap_node.js:149:9) at bootstrap_node.js:509:3

xiongwilee commented 8 years ago

你是直接执行的src/app.js吧,这里有一个对config的依赖,理论上入口文件应该是这个:bin/server.js; 你试试?

ipetu commented 8 years ago

我是运行的bin/server.js 但这样运行不起来。 刚找到解决办法: 我把bin/server.js 的js文件放到根目录底下就可以run 和debug 了。不知道为啥。/(ㄒoㄒ)/~~ 顺便问问大家一般开发nodejs用什么debug来调试啊~