Skip to content

Instantly share code, notes, and snippets.

@mrowa44
Last active March 8, 2017 17:45
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 mrowa44/9a96e8d0c67b1b5ea88247482a8cf68d to your computer and use it in GitHub Desktop.
Save mrowa44/9a96e8d0c67b1b5ea88247482a8cf68d to your computer and use it in GitHub Desktop.
debugging node in devtools with live reloading

Prerequisites: Node.js 6.3+, Chrome 55+, nodeamon

  • turn on chrome://flags/#enable-devtools-experiments & relaunch Chrome
  • open devtools settings > experiments, press shift 6 times (lol, for real) and check node debugging box
  • open & close devtools
  • nodemon --watch . --inspect app.js
  • connect to node in devtools (Sources > Threads (on the right) > Connect next to node)

Debugging tests: mocha --debug-brk --inspect --grep 'something' path/to/test.js

Or install node inspector manager and use with:

nodemon --watch . --inspect app.js
# or
mocha --debug-brk --inspect path/to/test/js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment