-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attaching to Node running in inspector mode cannot determine version #21104
Comments
Before you attach, can you open Were you connected to the internet when you tried this? If you set |
@roblourens Yes, I can open it. This is the data from the link: I was connected to the internet when I tried this.
|
Is that the full data, like it's not an array? |
@roblourens yes, it is the full data that I get on that link. |
Ah, the format of |
Hi, {
"type": "node",
"request": "attach",
"protocol": "auto",
"name": "Attach to Process",
"port": 5858
} And this is the error message: But I can't access to |
@MimoMoreno what version of node are you using and how are you starting node? |
@weinand I'm using v6.0.0 and I'm trying to start the debugger from the debug panel (from the activity bar). |
@MimoMoreno Your configuration from above does not launch "node". It tries to "attach" to a node process that is already running (that's the reason for the "attach" value of the "request" attribute). If node is not running, debugging will fail with the message you are seeing. So either you'll have to launch node from the command line, e.g. {
"type": "node",
"request": "launch",
"protocol": "auto",
"name": "Launch program",
"program": "myProgram.js"
} This will launch your program with node and then attach the debugger to it. |
BTW, node v6.0.0 is rather old. I suggest to use a more recent version that includes the recommended security fixes, e.g. v6.11.1 (LTS) or v8.2.1. |
@weinand I'm sorry, I didn't put all my configuration. This is it: {
"type": "node",
"request": "launch",
"protocol": "auto",
"name": "Launch Program",
"program": "${workspaceRoot}/app.js",
"cwd": "${workspaceRoot}"
},
{
"type": "node",
"request": "attach",
"protocol": "auto",
"name": "Attach to Process",
"port": 5858
} But yet with this configuration I cannot start debugging mode. |
@MimoMoreno these are two configurations. Which one are you using? |
@weinand thanks for that tip! I was using the |
As I've explained above:
Example: you can launch your node program independent from VS Code from the command line, e.g. as a server process running silently in the background. Suddenly you notice that the server behaves strangely and you want to understand why. You launch VS Code and then run the "Attach to Process" config. Please note that this requires that your node program has been launched with the |
BTW, as you could see now, your problem was completely unrelated to the problem described in this issue. |
Anyone coming to this thread in the future, I had ATTACH working on one project, and not the other. The difference between my two package.json files was I need the "main": "server.js". As soon as I added that, the debugger attached fine. |
While testing #20991:
Steps to Reproduce:
node --inspect --debug-brk server.js
in shell with simple server.js code.However, launching it in the
"request": "launch"
mode successfully defaults it to v7.5.0.Expected Behaviour:
Determine the running version of inspector.
The text was updated successfully, but these errors were encountered: