create a launch config under .vscode
with the following:
// .vscode/launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Goldfish",
"cwd": "${workspaceFolder}/packages/servers",
"type": "node",
"request": "attach",
"port": 9229
}
]
}
Now just run the node process normally via the terminal and then go to Run
> Start debugging
.
This is going to attach the debugger the the running node process on port 9229.
Make sure to start the node process with --inspect
, otherwise the debugger won't be able to be attached.