When it comes to debugging node applications you have a few options. Most people I know use their IDE’s debugger which does the work really well for them. The next option for people who don’t use IDE’s is usually node inspector, which does a pretty good job too. Not long ago I found out that Node comes with a command line built in debugger which I tried and I think is easy enough that may become my debugger of choice.
To start debugging an application just use the debug command before running it:
1 node debug app.js
When you do this your script will be loaded but the execution will stop at the first line. You will also get a debug> prompt where you can issue debugger commands.