I am trying to run my MEAN app through Visual Code debugger but I cannot start it. It is showing me a Cannot connect to runtime process, timeout after 10000 ms - (reason: Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:58... error. I am running Node 8.1.0 and npm 5.0.3. This is my launch configuration file
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch via NPM",
"runtimeExecutable": "npm",
"windows": {
"runtimeExecutable": "npm.cmd"
},
"runtimeArgs": [
"run",
"startdev"
],
"port": 5858,
"protocol": "inspector"
}
]
}
Whenever I execute my program I run it using npm run startdev, startdev being a script in my package.json. How do I start the debugger?
EDIT:
I am running the app using npm run startdev where the startdev is
"startdev": "concurrently \"ng build --watch\" \"cross-env NODE_ENV=development nodemon ./bin/start.js\""
I also tried an attach configuration as such but to no avail
{
"type": "node",
"request": "attach",
"name": "Attach to Process",
"processId": "${command:PickProcess}",
"port": 5858
}