Console output on debugging:
DeprecationWarning: node --debug is deprecated. Please use node --inspect instead.
Steps to Reproduce:
@ruskakimov what node version are you using?
@weinand v7.7.1
The deprecation message is correct and produced by that version of node.
Please read the following section of the VS Code 1.10.1 release notes: https://code.visualstudio.com/updates/v1_10#_node2-transitioning
(In short: add a "protocol": "inspector" or "protocol": "auto" to your launch configuration).
I am still seeing this deprecation message even after using
"type":"node",
"protocol": "inspector",
in my launch.json. This is also with VS Code 1.10.1 and Node.js 7.7.1 on macOS. Am I missing something? The suggested fix doesn't change anything.
@steve-p-com Did you add it to the existing config for program launch?
Like this one:
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${file}",
"cwd": "${workspaceRoot}",
"protocol": "auto"
}
This works for me. But adds an experimental feature warning :rofl:.
Yes. Because it was a new project today I just added protocol to the default launch.json, actually like this:
{
"type": "node",
"protocol": "inspector",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/index.js"
},
but the result should be the much same I guess.
When I changed launch.json, it initially continued to produce the deprecation warning. Now though, it is behaving as expected. What is more puzzling is that if I remove the protocol property again, so it looks like this:
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/index.js"
},
it doesn't revert to producing the deprecation warning, even though it seems like it should. That seems weird.
Never mind, I've figured out what's going on. There is an unexpected (to me) difference in behaviour between start and restart debugger commands. Unless you stop the debugging session completely and use start again, it doesn't pick up any changes in launch.json. I was under the impression that restart was just shorthand for stop followed by start, but evidently it is not.
@ruskakimov funny that, you wouldn't think running the latest release versions of code and node would have only "depreciated" or "experimental" debug options.
VS Code 1.10.x does no longer use the term "experimental" (and it never used the "deprecated" for a node version).
It it node that produces these "deprecated" or "experimental" messages without providing some "normal" option:
node --debug
(node:64180) DeprecationWarning: node --debug is deprecated. Please use node --inspect instead.
and
node --inspect
Warning: This is an experimental feature and could change at any time.
@weinand It doesn't look like setting protocol to inspector or auto works when using compounds. If I run the following DEV it uses inspector, but if I run DEV/Chrome it uses legacy for DEV.
{
"version": "0.2.0",
"configurations": [
{
"name": "DEV",
"type": "node",
"request": "launch",
"protocol": "inspector",
"program": "${workspaceRoot}/index.js",
"stopOnEntry": false,
"args": [
"dev"
]
},
{
"name": "Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:8080",
"webRoot": "${workspaceRoot}/public",
"userDataDir": "${env:TEMP}/VSCodeChrome/${workspaceRootFolderName}"
}
],
"compounds": [
{
"name": "DEV/Chrome",
"configurations": [
"DEV",
"Chrome"
]
}
]
}
Also, even when running just DEV by itself it executes node --inspect=12680 --debug-brk index.js dev instead of the expected node --inspect=12680 --inspect-brk index.js dev.
@ugate good find, but unrelated to this issue. Please create a new issue.
/cc @isidorn
@ksix @ruskakimov @weinand @steve-p-com @ugate
how to sweep away this warning?
Warning: This is an experimental feature and could change at any time.
@BB-Bibo the warning message is produced by node.js when using the '--inspect' flag.
Please ask on the node.js repository for how to get rid of this warning.
VS Code has no control over this.
@weinand Thank you for solving my problem!love u~
@weinand I'm running Visual Studio Code v1.12.2 and NodeJs v8.0.0.
I tryed to enable the inspector mode in launch.json because I need to debug big arrays but I still get DeprecationWarning: node --inspect --debug-brk is deprecated. Please use node --inspect-brk instead, and I cannot debug because Visual Studio Code freezes. Where do I do it wrong?
launch.json
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}\\server\\server.js",
"protocol": "inspector"
}
Thanks
@Gappa88 the launch config is correct and you can safely ignore the "--debug-brk" deprecation warning.
Without more information I have no clue why VS Code freezes. Which OS? Is this reproducible? When and how does VS Code freeze?
/cc @roblourens
@weinand
It seems to work correctly now after I have restarted Visual Studio Code. When I go to inspect an array of 80000 elements it stucks for a while but after that I can slide the array nicely!
Thank you very much
I also get the deprecation warning. Node 8.4.
```
{
"name": "Jest Tests",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts",
"runtimeArgs": [
"--inspect-brk",
"test"
],
"args": [
"--runInBand",
"--no-cache",
"--env=jsdom"
],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
Still expected, tracking in https://github.com/Microsoft/vscode/issues/27731
Most helpful comment
The deprecation message is correct and produced by that version of node.
Please read the following section of the VS Code 1.10.1 release notes: https://code.visualstudio.com/updates/v1_10#_node2-transitioning
(In short: add a
"protocol": "inspector"or"protocol": "auto"to your launch configuration).