Skip to content

Instantly share code, notes, and snippets.

@AlexZeitler
Forked from kagemusha/gist:5866759
Last active September 7, 2015 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexZeitler/4894f93c935c0f7c1495 to your computer and use it in GitHub Desktop.
Save AlexZeitler/4894f93c935c0f7c1495 to your computer and use it in GitHub Desktop.
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
node-inspector
5. Use your browser console to step thru your code
http://0.0.0.0:8080/debug?port=5858
Note: when you inspect variables from the console, can take a while for values to show up
Ref:
https://github.com/dannycoates/node-inspector
http://stackoverflow.com/questions/11171013/using-node-inspector-with-grunt-tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment