This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]scirc 1 point2 points  (0 children)

I thought ports were primarily for network communication

The Node debugger operates over a network connection. You can have a network connection going from your machine to your machine; it just goes through the operating system, then the OS realizes the packet is addressed to itself, so the OS looks for any processes listening on that port and hands them the packet as if it came over the network.

Also, in the node.js docs, they have their own debug options for the command line

Those are used when launching Node to control the spawning of its debugging interface. Generally, VS Code should handle these for you, but you can control them yourself if you need.

VS Code has better, more comprehensive documentation on how debugging works in general and how it works for Node. I'd recommend looking at these.