Debugging with node-inspector & Chrome

272 views
Skip to first unread message

John English

unread,
Aug 4, 2015, 9:13:08 AM8/4/15
to nodejs
I'm getting a bit frustrated with using node-inspector with Chrome. I quite often come across an anomaly while debugging ("how did that value get there?", "why isn't that value there?", you know the sort of thing), then I want to restart and focus on that anomaly to try and spot the root cause of the problem.

In most debuggers there's a "stop" button, and you can then press "run" to start again from the beginning. But there doesn't seems to be a stop button, or any other way to restart execution. If I try reloading the page in Chrome, it just spins its wheels uselessly. If I close Chrome and then reopen it, it tells me it's "detached from the target" but the only thing that seems to work then is to close Chrome, close node-inspector, restart node-inspector, restart Chrome, and reconnect...

Please tell me I'm being stupid and missing something obvious; it surely can't be so difficult to use what is otherwise a very nice debugger?

TIA,

Will Hoover

unread,
Aug 5, 2015, 10:34:24 AM8/5/15
to nodejs

https://github.com/s-a/iron-node looks like an interesting alternative

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 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 unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/0c6b20c9-bfb5-497e-b17b-d9a5cc716b82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

asleepysamurai

unread,
Aug 5, 2015, 10:34:24 AM8/5/15
to nodejs
If I understand correctly, you want to restart your node program, and have node-inspector attach to it while in the middle of a debugging session.

Typically, restarting your node app in debug mode via the command line and refreshing chrome should do the trick.

If you want node-inspector to pause on the first line of code before any line is executed, then start your node app with the --debug-brk flag rather thab the --debug flag.

Hope this helps.

Facundo Chambo

unread,
Aug 5, 2015, 10:34:24 AM8/5/15
to nodejs
Hi, check this video https://youtu.be/03qGA-GJXjI to learn how to use de debugger.
which page are you trying to reload? I guess it is not the debbuger's.
when you start your app it stops automatically in the first line of your app. You have to continue the execution from the debugger. then put a breakpoint where you want to stop your execution.

Hope it helps.
Reply all
Reply to author
Forward
0 new messages