简体   繁体   中英

VScode debugger not stopping on breakpoints while debugging a remote node server

I'm trying to debug my remote node server through VSCode and it doesn't stop on any of the breakpoints i've configured.

I'm running VSCode on my mac where i have one copy of the node project and i have another copy of the same node project on a remote machine, both copies of the node project are synced.

i'm running the node server on the remote machine using the following command:

sudo node --inspect=5858 app.js

and my VSCode launch.json configurations are as follow:

{   
    "name": "Attach",
    "type": "node",
    "request": "attach",
    "port": 5858,
    "address": "remote server addr",
    "localRoot": "${workspaceFolder}",
    "remoteRoot": "the path to project directory on remote server",
    "protocol": "auto"
}

When i launch the debugger on VSCode it seems like it connects to the remote server but it doesn't stop at any of my breakpoints.

VSCode version is 1.28.1

Node version is 9.11.2

What am i missing?

I found the solution to my question the configuration i was missing is server=4771

when i run my app as follow:

sudo node --inspect=5858 app.js server=4771

VSCode debugger is able to debug my remote node server, more details about it are mentioned here: https://code.visualstudio.com/docs/extensions/example-debuggers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM