AngeloC
AngeloC

Reputation: 3523

debugging node 8 with visual studio code?

Using Visual Studio Code Version 1.13.0, when started a node debug test2.js, the node is version 0.12 with following config, I can debug and response from vscode was:

Debugging with legacy protocol because it was detected.

but when the node is V8.0 and 'node debug test2.js' is issued, debugging VSCODE got:

Debugging with legacy protocol because Node.js version could not be determined (Error: read ECONNRESET)

Any idea why? I'm using 'attach', the config as follow:

"version": "0.2.0",
"configurations": [
  {
    "type": "node",
    "request": "attach",
    "name": "Attach",
    "port": 5858
  }
  {
    "type": "node",
    "request": "launch",
    "name": "Launch Program",
    "program": "${file}"
  }
]

Upvotes: 4

Views: 6704

Answers (2)

Goman.ouyang
Goman.ouyang

Reputation: 1

If you still get the error: debugging with legacy protocol because node.js version could not be determined

Use the following steps:

  1. brew uninstall node.
  2. restar computer.
  3. brew install node.

It works in Visual Studio Code Version 1.15.1; node Version 8.4.0

Upvotes: -2

eol
eol

Reputation: 24565

You need to use the new "inspector" protocol as the documentation says:

 {
        "type": "node",
        "request": "attach",
        "name": "Attach (Inspector Protocol)",
        "port": 9229,
        "protocol": "inspector"
 }

Upvotes: 7

Related Questions