Cannot get node inspector

I have a main express application that I am trying to debug, but I can not get the node inspector to work correctly on OSX

In one terminal window, I run:

node --debug-brk server.js

In another terminal window, I run:

node-inspector

Node The inspector opens here:

http://localhost:8080/debug?port=5858

In another browser tab, I am trying to open my site here.

http://localhost:8080/

I am typing on the screen

Cannot GET /

If I open instead

http://localhost:3000

I get my application because I installed it in server.js

app.set('port', process.env.PORT || 3000);

But now none of the breakpoints work in the debugger

I'm sure I'm doing something stupid here, but I read documents and tutorials over and over again, and I can't get this to work.

Other things I tried are in one terminal window:

node-debug server.js

I get the same as above. The debug inspector opens and stops in the first line, and my site in

http://localhost:8080

Cannot GET /

node-debug --no-debug-brk server.js

, node,

+4
1

...

node-inspector , . http://localhost:3000, , .

- , script node-inspector --no-debug-brk, .

, node-inspector , :

  • , app.listen, ;
  • : .
+1

All Articles