views:

1177

answers:

3

How do I debug a node.js server application? Right now I'm mostly using alert debugging with print statements like this:

sys.puts(sys.inspect(someVariable));

There must be a better way to debug. I know that google Chrome has a command line debugger. Is this debugger available for node.js as well?

+6  A: 

Does node_debug meet your needs?

Jordan
At the moment it's far from being a real debugger. However it is still neat.
Fabian Jakobs
+8  A: 

The V8 debugger released as part of the Google Chrome Developer Tools can be used to debug node.js scripts. A detailed explanation of how this works can be found in the node.js github wiki.

There is also ndb, a command line debugger written in node itself.

Fabian Jakobs
+2  A: 

node-inspector could save the day! Use it from any browser supporting websockets. Breakpoints, profiler, livecoding etc... It is really awesome.

daralthus