1

I read about node-inspector as a suggestion for debugging node code.

However I have found no clear instructions on how to use it, and the documentation is awful.

I installed node-inspector and then did

node-inspector --web-port=5858 &

I get a message saying

Visit http://127.0.0.1:5858/?ws=127.0.0.1:5858&port=5858 to start debugging. 

which I do.

Now I get a blank console page.

But the docs stop here. What do I do next to actually debug my app?

Blank node inspector console

2 Answers 2

1

Click the 'source' tab to see all the files used by your nodejs project. When the debugger starts it stops code execution at the first line automatically without setting any breakpoint, this lets you set more breakpoints if necessary. After setting breakpoints, click on 'Run' or 'Resume execution' button to proceed.

Sign up to request clarification or add additional context in comments.

Comments

0

For the first usage you can follow next instruction:

  1. Create new project with only index.js

var a = 0; setTimeout(function() { debugger; console.log(a++); }, 1000);

  1. Open your preferred shell in project dir and execute node-debug index

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.