first run the commands below as sudo code. --user-data-dir='.' sudo code. --user-data-dir='.' super user sudo code. --user-data-dir='.' sudo code. --user-data-dir='.' sudo code. --user-data-dir='.' the visual code studio opens, import your project folder and install the launch.json file as shown below
{ "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Launch Program", "program": "${workspaceFolder}/app/release/web.js", "outFiles": [ "${workspaceFolder}/**/*.js" ], "runtimeExecutable": "/root/.nvm/versions/node/v8.9.4/bin/node" } ] }
the path to runtimeExecutable will be displayed with the "Which "which node" command.
Start the server in debug mode
source share