To debug, we have to modify the grunt file under bin. On my machine, grunt is installed globally, so I went to /usr/local/lib/node_modules/grunt/bin
I opened the file and modified:
#!/usr/bin/env node
To
#!/usr/bin/env node --debug-brk
--debug-brk will break on the first line of javascript ran.
Doing that alone isn't quite enough though, since you won't be able to find you're grunt task js file in the drop down in node inspector, so you have to modify the file you're interested in debugging by adding debugger;
where you want the breakpoint to happen.
Now you can click continue after the first break, and you'll break on you're debugger;
line
Pretty kludgy, but it's the only way I've found so far.
node-inspector
that talks tonode --debug
, providing the debug info to a browser that connects. This is awesome, because you can then connect Chrome to the node-inspector process, and use all the web inspector tools to debug your app. github.com/dannycoates/node-inspector – Zaremski