How to debug child Node.JS process in Visual Studio Code?


Vinianski

How to debug child Node.JS processes in VS Code?
Here is an example of the code I am trying to debug:

var spawn = require('child_process').spawn;
var scriptPath = './child-script.js';
var runner_ = spawn('node', [scriptPath]);
Benjamin Passero

You can easily add a new launch configuration to launch.json that allows you to connect to a running node instance using a specific port:

{
        "name": "Attach to Node",
        "type": "node",
        "address": "localhost",
        "port": 5870,
}

Just make sure to fork/spawn the node process with the --debug or --debug-brk parameter .

Related


How to debug child Node.JS process in Visual Studio Code?

Vinianski How to debug child Node.JS processes in VS Code? Here is an example of the code I am trying to debug: var spawn = require('child_process').spawn; var scriptPath = './child-script.js'; var runner_ = spawn('node', [scriptPath]); Benjamin Passero You c

How to debug child Node.JS process in Visual Studio Code?

Vinianski How to debug child Node.JS processes in VS Code? Here is an example of the code I am trying to debug: var spawn = require('child_process').spawn; var scriptPath = './child-script.js'; var runner_ = spawn('node', [scriptPath]); Benjamin Passero You c

How to create conditional debug visual studio code using node js

Basil Battikhi I have a loop that has a huge iteration of about 300 iterations, which may be small, but I'm having trouble debugging the loop, let's look at the code below (example, it's not exactly part of the code) . const myVar = [ { name: 'basil', age: 2

How to create conditional debug visual studio code using node js

Basil Battikhi I have a loop that has a huge iteration of about 300 iterations, which may be small, but I'm having trouble debugging the loop, let's look at the code below (example, it's not exactly part of the code) . const myVar = [ { name: 'basil', age: 2

How to create conditional debug visual studio code using node js

Basil Battikhi I have a loop that has a huge iteration of about 300 iterations, which may be small, but I'm having trouble debugging the loop, let's look at the code below (example, it's not exactly part of the code) . const myVar = [ { name: 'basil', age: 2

How to debug child_process fork process from Visual Studio Code

Vizebin describe child_process.forkExecution from vscode debug process fails to run and returns exit code 12. Running the same test from a terminal session succeeds. Sample Mocha unit test import { expect } from 'chai'; import { fork } from 'child_process'; im

How to debug child_process fork process from Visual Studio Code

Vizebin describe child_process.forkExecution from vscode debug process fails to run and returns exit code 12. Running the same test from a terminal session succeeds. Sample Mocha unit test import { expect } from 'chai'; import { fork } from 'child_process'; im

Debug Node js with Visual Studio Code

Jacabello I tried to debug the project in node JS using Visual Studio Code but it didn't work. I built a simple project with: express myExpressApp cd myExpressApp npm install npm start My file launch.json: I select the "Launch app.js" option in the "Debug" win

Debug Node js with Visual Studio Code

Jacabello I tried to debug the project in node JS using Visual Studio Code but it didn't work. I built a simple project with: express myExpressApp cd myExpressApp npm install npm start My file launch.json: I select the "Launch app.js" option in the "Debug" win

Debug node.js in Visual Studio Code preview on OS X

Lone Ranger I'm trying the newly released preview of Visual Studio Code on Mac OS X and I get the error "Cannot start OpenDebug due to Mono (or Mono version >= 3.10.0) when trying to start debugging or attaching to my node.js app , so OpenDebug cannot be start

Visual Studio Code - Debug Node JS via TypeScript

Brutus I'm currently trying to debug a Node JS application written in TypeScript from Visual Studio Code and I'm running into some issues. I have a situation similar to the one described in this question |-- .settings |----- launch.json |-- bin |----- app.js |

Debug node.js in Visual Studio Code preview on OS X

Lone Ranger I'm trying the newly released Visual Studio Code preview on Mac OS X and I get the error "Cannot start OpenDebug due to Mono (or Mono version >= 3.10.0, Therefore cannot start OpenDebug)) is required". I have installed Mono MDK from http://www.mono

Visual Studio Code - Debug Node JS via TypeScript

Brutus I'm currently trying to debug a Node JS application written in TypeScript from Visual Studio Code and I'm running into some issues. I have a situation similar to the one described in this question |-- .settings |----- launch.json |-- bin |----- app.js |

Debug node.js in Visual Studio Code preview on OS X

Lone Ranger I'm trying the newly released Visual Studio Code preview on Mac OS X and I get the error "Cannot start OpenDebug due to Mono (or Mono version >= 3.10.0) when trying to start debugging or attaching to my node.js app , so OpenDebug cannot be started)

Visual Studio Code - Debug Node JS via TypeScript

Brutus I'm currently trying to debug a Node JS application written in TypeScript from Visual Studio Code and I'm running into some issues. I have a situation similar to the one described in this question |-- .settings |----- launch.json |-- bin |----- app.js |

Visual Studio Code - Debug Node JS via TypeScript

Brutus I'm currently trying to debug a Node JS application written in TypeScript from Visual Studio Code and I'm running into some issues. I have a situation similar to the one described in this question |-- .settings |----- launch.json |-- bin |----- app.js |

Visual Studio Code - Debug Node JS via TypeScript

Brutus I'm currently trying to debug a Node JS application written in TypeScript from Visual Studio Code and I'm running into some issues. I have a situation similar to the one described in this question |-- .settings |----- launch.json |-- bin |----- app.js |

Visual Studio Code - Debug Node JS via TypeScript

Brutus I'm currently trying to debug a Node JS application written in TypeScript from Visual Studio Code and I'm running into some issues. I have a situation similar to the one described in this question |-- .settings |----- launch.json |-- bin |----- app.js |

Debug node.js in Visual Studio Code preview on OS X

Lone Ranger I'm trying the newly released preview of Visual Studio Code on Mac OS X and I get the error "Cannot start OpenDebug due to Mono (or Mono version >= 3.10.0, Therefore cannot start OpenDebug)) is required". I have installed Mono MDK from http://www.m

Debug node.js in Visual Studio Code preview on OS X

Lone Ranger I'm trying the newly released Visual Studio Code preview on Mac OS X and I get the error "Cannot start OpenDebug due to Mono (or Mono version >= 3.10.0) when trying to start debugging or attaching to my node.js app , so OpenDebug cannot be started)

Visual Studio Code - Debug Node JS via TypeScript

Brutus I'm currently trying to debug a Node JS application written in TypeScript from Visual Studio Code and I'm running into some issues. I have a situation similar to the one described in this question |-- .settings |----- launch.json |-- bin |----- app.js |

Visual Studio Code - Debug Node JS via TypeScript

Brutus I'm currently trying to debug a Node JS application written in TypeScript from Visual Studio Code and I'm running into some issues. I have a situation similar to the one described in this question |-- .settings |----- launch.json |-- bin |----- app.js |

Visual Studio Code - Debug Node JS via TypeScript

Brutus I'm currently trying to debug a Node JS application written in TypeScript from Visual Studio Code and I'm running into some issues. I have a situation similar to the one described in this question |-- .settings |----- launch.json |-- bin |----- app.js |

Visual Studio Code - Debug spawned process

Chabertin Project setup is a basic express app, generated by express-generator. The vscode-debugging-node project can be found on GitHub Please refer to the screencast in Visual Studio Code - Debugging a Node Application The root of the project, manages the de

Visual Studio Code - Debug spawned process

Chabertin Project setup is a basic express app, generated by express-generator. The vscode-debugging-node project can be found on GitHub Please refer to the screencast in Visual Studio Code - Debugging a Node Application The root of the project, manages the de

Visual Studio Code - Debug spawned process

Chabertin Project setup is a basic express app, generated by express-generator. The vscode-debugging-node project can be found on GitHub Please refer to the screencast in Visual Studio Code - Debugging a Node Application The root of the project, manages the de

Visual Studio Code - Debug spawned process

Chabertin Project setup is a basic express app, generated by express-generator. The vscode-debugging-node project can be found on GitHub Please refer to the screencast in Visual Studio Code - Debugging a Node Application The root of the project, manages the de