1

I have:

  • latest Visual Studio Code
  • Express js
  • Node js

This is my Attach configuration:

{
    "version": "0.1.0",
    // List of configurations. Add new configurations or edit existing ones.
    "configurations": [
        {
            "name": "Attach",
            "request": "attach",
            "type": "node",
            // // TCP/IP address. Default is "localhost".
            // //"address": "localhost",
            // // // Port to attach to.
            "port": 5858
        }
    ]
}

This is the gulp task starting the application:

gulp.task('server', function (cb) {
    exec('mongod', function (err, stdout, stderr) {
      console.log(stdout);
      console.log(stderr);
      cb(err);
    });
    exec('node server.js', function (err, stdout, stderr) {
      console.log(stdout);
      console.log(stderr);
      cb(err);
    });
})

And this is the result of running Attach

request 'attach': cannot connect to runtime process (timeout after 10000ms)

What I'm doing wrong and why? How can I attach Visual Studio Code debugger to running Node app and debug server.js?

0

1 Answer 1

0

You will see this timeout error if the server isn't running when you try to attach the debugger. The client starts the language server so make sure you have started the client in order to have a running server.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.