What debugging options are available for Node.js? Especially in Visual Studio Code

I came from development in ASP.NET MVC / C # using Visual Studio. In this stack, debugging is very thorough and simple. You create a project, code, set breakpoints and press F5 to go through them.

What are my options with Node.js? In particular, using Visual Studio code? I tried setting up a debug configuration file, but it has mixed results and seems to be much more error prone than debugging in C # / Visual Studio. Is there a way to get the debugging features ordered in Node the same way I'm used to in Visual Studio with C #? I know that JS is interpreted, not compiled ...

Update: I tried to press the debug button and configure the launch.json file. However, this usually leads to errors. For example, I set start.json to the entry point to the application, and my application uses the MVC pattern. When I run the application, the debugger stops at the breakpoint before I even get to the controller endpoint, whereas in Visual Studio with C # the debugger will listen, and when I pick up the endpoint, it will stop at the breakpoint so that I can step through. The Visual Studio Code / Node debugger seems to want to go through all the breakpoints before the endpoints are even started. I also tried the Nodejs Tools extension for the Visual Studio 2015 community, which resulted in Microsoft Typescript errors. It just doesn't seem very simple.

+4
source share
2 answers

Have you tried using Chrome? When in Chrome press F12 to display the developer tools, you have an output console and you can see the source and set breakpoints.

0
source

Below are some options for debugging a node outside of visual studios: How to debug Node.js applications?

Now for the backend, I would recommend using Postman for Chrome: https://www.getpostman.com/

API . , API, , API, , .

, , , .

0

Source: https://habr.com/ru/post/1658146/


All Articles