Debugging with node.js

181 views
Skip to first unread message

Dave Johnson

unread,
Nov 29, 2012, 12:52:52 PM11/29/12
to nod...@googlegroups.com
Hello,
 
I am trying to debug a very simple app in node.js and I am having problems.
 
Here are my stages:
 
1. In node.js console:
npm install -g node-inspector
 
2. In app.js:
var foo = function(){
  var a = 3, b = 5;
  debugger;
  var bar = function() {
    var b = 7, c = 11;
    a += b + c;
    debugger;
  }
  bar ();
  debugger;
};
foo();
 
3. In node.js console:
node --debug-brk app.js
 
Response: debugger listening on port 5858
 
4. In another node.js console:
node-inspector
 
Response:
info  - socket.io started
visit http://0.0.0.0:8080/debug?port=5858 to start debugging
 
 
However if I browse to http://0.0.0.0:8080/debug?port=5858 I just get:
 

This webpage is not available

The webpage at http://0.0.0.0:8080/debug?port=5858 might be temporarily down or it may have moved permanently to a new web address.
Error 108 (net::ERR_ADDRESS_INVALID): Unknown error.
Any ideas where I am going wrong here?
Thanks, Dave J.
 

José F. Romaniello

unread,
Nov 29, 2012, 12:54:42 PM11/29/12
to nod...@googlegroups.com
if you are running this on windows 0.0.0.0 doesnt exist there.. you should use 127.0.0.1 or localhost


2012/11/29 Dave Johnson <davejohn...@gmail.com>

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Dave Johnson

unread,
Nov 29, 2012, 1:20:55 PM11/29/12
to nod...@googlegroups.com
http://127.0.0.1:8080/debug?port=5858 seems to do the trick many :) Many thanks

Mark Hahn

unread,
Nov 29, 2012, 1:44:15 PM11/29/12
to nodejs
You need to replace 0.0.0.0 with an ip address to your server.
Reply all
Reply to author
Forward
0 new messages