Skip to content

Instantly share code, notes, and snippets.

@christiearcus
Created July 20, 2016 11:51
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 christiearcus/3f1e61ebf7c126ca8c0ba963227714fe to your computer and use it in GitHub Desktop.
Save christiearcus/3f1e61ebf7c126ca8c0ba963227714fe to your computer and use it in GitHub Desktop.
Debugging tools for node.

To be able to debug & reload for node apps (e.g. express), here are some steps:

npm install -g nodemon npm install -g node-inspector

  • When running your app, instead of node app.js, you can now run nodemon app.js and it will restart the app on change.
  • To run in debug mode, start your app with nodemon --debug app.js. Then start node-inspector node-inspector.
  • Use the localhost URL provided by node-inspector to view your app in the console.
  • When you want to debug, put a debugger statement in your code. When you refresh your browser (on your app process), node-inspector will break at that point and allow you to debug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment