jakejs / jake

JavaScript build tool, similar to Make or Rake. Built to work with Node.js.
http://jakejs.com
Apache License 2.0
1.97k stars 190 forks source link

How to attach debugger #226

Closed MichaelPaulukonis closed 11 years ago

MichaelPaulukonis commented 11 years ago

How can I attach the debugger to a jake process?

Specifically, I'm trying to use node-inspector, but since that requires an already-running-node-process (and my jakefile tasks don't take that long) or a node-process started with debug-break (say node --debug-brk <file.js>)...

Unless I add in some jiggery-pokery to cause a task to wait for console input, how can this be done?

MichaelPaulukonis commented 11 years ago

I don't know if this is the best way, but I found the following to work:

node --debug-brk "\path\to\node_modules\jake\bin\cli.js" <rest of jake parameters>

mde commented 11 years ago

Yes, running the cli.js directly while passing your debug param to Node is the best way.

virtualpatterns commented 8 years ago

Thanks!