1

I'm trying to get started with NodeJS (8.12.0) in Visual Studio 2017 (15.8.4). My understanding is that Node's output is supposed to appear in the Visual Studio 2017 Output window (https://stackoverflow.com/a/49589521), but it is not. I also thought that in the case of an error/exception, Node's pop-up console should remain open until you dismiss it (http://www.intstrings.com/ramivemula/articles/jumpstart-35-prevent-visual-studio-node-js-console-closing-immediately-after-execution/), but that also seems not to be the case: if I run code with an exception, the console pops up & immediately closes.

With no errors in the code I can force the console to stay open with something like:

setTimeout(function () { process.exit(); }, 5000);

...But obviously that's just a workaround, and it still doesn't work if there's actually an error.

Am I wrong in that Node should be outputting to VS's output window, and/or remaining open to allow me to read potential errors? I've googled & googled, but can't seem to figure out why neither of these are happening in my case, nor how to resolve them. Any thoughts would be greatly appreciated.

J23
  • 3,061
  • 6
  • 41
  • 52

1 Answers1

1

Check Visual Studio 2017 Node.js Exceptions not working

Escpecially "Debug->Windows->Exceptions->Enabling JavaScript (Node.js 8+)" did the trick.

  • Unfortunately I long since abandoned Visual Studio for Node development, & moved over to VS Code (this question was from 17 month ago). What's the proper protocol for accepting answers that I can't myself verify...? – J23 Mar 13 '20 at 04:16