VS Code Launch Configuration for Node as SUDO

47 views Asked by At

I need to remote debug a node express script, actually i'm doing it from a remote-ssh session. Unfortunatly some functionalities, as the access to FS, dont't work as expected unless I run the node with sudo privileges.

How can I run the Node.js script as sudo from within Visual Studio Code?

This is my actual Launch configuration

{
    "name": "NodeJS Local Server",
    "program": "${workspaceFolder}/main.js",
    "request": "launch",
    "args":["tmparg"],
    "skipFiles": [
        "<node_internals>/**"
    ],
    "type": "node"
},

Any suggestion would be appreciated.

0

There are 0 answers