I have a JavaScript file that I'd like to edit and debug.
The code isn't DOM/browser/web specific.
Can I use VS Code to run and debug JavaScript without a web project like Node or ASP.NET? If so, how? Perhaps VS Code assumes it'll have a web server like Node to attach and debug
How should I modify my launch.json if necessary?
Loading a .js file and hitting F5 results in
Connection Failed
OpenDebug process has terminated unexpectedly
I was having the same frustrating issue. The problem is node.exe is not in your PATH. You can check this by running cmd.exe, typing node and seeing if it runs or not. If it fails, this may help you:
Hit F5 in Code. It should create / open a launch.json file. In that file, change this line:
"runtimeExecutable": null,
to this:
"runtimeExecutable": "C:\\Program Files\\nodejs\\node.exe",
A more permanent solution would be to add node.exe to your PATH variable and reboot.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With