I have a NodeJs project and I run it using nodemon,
I wish to run it in debug mode for development tasks, but I am unable to do so.
I found that I\'ll need to ad
Change package.json to
"scripts": {
"dev": "node app.js",
"debug": "nodemon --inspect app.js"
}
--inspect is for versions >= 6.3. --legacy or --auto for older versions
And launch.json to:
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Node: Nodemon",
"processId": "${command:PickProcess}",
"restart": true,
"protocol": "inspector"
}
]
the restart flag is the key here.
Start app via new debug script
npm run debug
See more: vscode nodemon recipe