Andrew Kim Andrew Kim - 2 years ago 87
Ruby Question

debugger for node not working

This is probably something really simple but scouring the web for a nodeJS replacement for ruby's


I have the following

var x = 10;
var y = 5;

Then I run the following in the terminal:

$ node debug testDebugger.js

I type in x and get
ReferenceError: x is not defined

Heres the entire sequence:

$ node debug app.js
< Debugger listening on port 5858
debug> . ok
break in app.js:1
> 1 var x = 10;
2 debugger;
3 var y = 5;
debug> x
ReferenceError: x is not defined

any ideas? Really love
in my rails apps and i hate being relegated to millions of

Answer Source

In order to inspect variables You could switch into repl mode.

Also note that debugger has stopped at the first line, so x is not declared yet.

debug> cont
debug> repl
> x
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download