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

前端 未结 5 2431
别那么骄傲
别那么骄傲 2021-02-19 19:42

How to debug child Node.JS process in VS Code?
Here is the example of the code that I\'m trying to debug:

var spawn = require(\'child_process\').spawn;
var s         


        
5条回答
  •  一整个雨季
    2021-02-19 19:47

    In your launch configuration add "autoAttachChildProcesses": true like shown below

    {
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "autoAttachChildProcesses": true,
      "program": "${workspaceFolder}/index.js"
    }
    

提交回复
热议问题