Debug Node.JS on VS Code EADDRINUSE error
<p>I am trying to debug a Node.JS application on VS Code but, when the terminal opens, I get this message: </p>

<p>Error: listen EADDRINUSE :::5858</p>

<p>My application uses a framework called StrawJS (<a href="https://github.com/simonswain/straw" rel="noreferrer">https://github.com/simonswain/straw</a>) and it starts some different processes at the same time. I think that this is the cause of the error because there are many different processes trying to use the same debugger.</p>

<p>I found a similar question (<a href="https://stackoverflow.com/questions/35109857/vscode-will-not-stop-on-breakpoints-when-first-node-prcess-forks-a-second">VSCode will not stop on breakpoints when first node prcess forks a second</a>) but configure the port on the attach.js file didn't work, the problem persists.</p>

<p>This is my actual launch.json file:</p>

<pre><code>{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch",
        "type": "node",
        "request": "launch",
        "port": 5858,
        "program": "${workspaceRoot}/run.js",
        "stopOnEntry": false,
        "args": [],
        "cwd": "${workspaceRoot}",
        "preLaunchTask": null,
        "runtimeExecutable": null,
        "runtimeArgs": [
            "--nolazy"
        ],
        "env": {
            "NODE_ENV": "development"
        },
        "externalConsole": true,
        "sourceMaps": false,
        "outDir": null
    }
]}
</code></pre>

<p>Thank you!</p>