Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Using Debugger with Grunt
version: grunt-cli v0.1.8
1. Install node-inspector globally (-g)
npm install -g node-inspector
2. Add debugger statements to your code
3. Run your grunt task in debug mode
node --debug-brk $(which grunt) <your-grunt-task>
--debug-brk stops on first line
in theory you can use just --debug instead of --debug-brk
which will stop at your first debugger statement
but i haven't had luck w it
4. Run node inspector
5. Use your browser console to step thru your code
Note: when you inspect variables from the console, can take a while for values to show up

This comment has been minimized.

Copy link

@hmbadiwe hmbadiwe commented Oct 16, 2013

Thanks for this gist. It was very helpful.
However, I'm never able to get node-inspector to recognize any of the breakpoints I set ( using the debugger statement or setting a breakpoint in the browser ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.