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

前端 未结 5 2333
别那么骄傲
别那么骄傲 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:51

    Just add this to your debugger configuration file

    {
      "type": "node",
      "request": "attach",
      "name": "Attach by Process ID",
      "processId": "${command:PickProcess}",
    }
    

    To attach a debugger to a Process Id. A list of processes will be prompted when you run this config., in which you can select process to which you want to attach debugger.

提交回复
热议问题