I want to debug node like this in terminal:
$sudo node app
But, in vscode, I don't know where I can configure it.
This is my launch.json. Nothing has helped,
launch.json
In order to run the command as sudo you have to launch VS code under sudo. Here's how you do that ...
First, create attach process config:
{
"name": "Attach to Process",
"type": "node",
"request": "attach",
"port": 9222
}
and run it.
Second, run node to debug like this.
sudo node --inspect=9222 app.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With