
In the “Breakpoints” panel you can activate and deactivate your breakpoints using the checkboxes. If no prior configurations have been made, there are 2 tabs in the debug panel. You can also press Ctrl+Shift+D to open the same panel. Open the debug panel by clicking the bug icon on the activity bar. You can place them in between suspected regions or randomly if you have no idea where the bug is hiding. Breakpoints will aid in identifying the line or region where your code is failing. A red dot will appear when a breakpoint has been set. Do this by clicking on the left side of the line numbers where you would like your code to stop. Next, open the Node.js file you want to debug and set some breakpoints. You can look for an Auto Attach: On statement at the bottom blue bar in VS Code to confirm. This will always be enabled for Node.js applications from now on. On the left side under Extensions, click Node debug. You can also open the Command Palette ( Ctrl+Shift+P) and type Preferences: Open Settings(UI), or find the gear icon in the lower left corner of the interface. If not, download the latest version from here.

and has made debugging Node.js apps a very simple and straightforward process.īefore proceeding, make sure you have the VS Code editor installed on your computer. VS Code can also be used to debug many languages like Python, JavaScript, etc. Its features can be further enhanced by the use of extensions. Visual Studio Code (VS Code) is a code editor made by Microsoft that is used by developers worldwide due to the many tools and features it offers. But, what if I were to tell you there is a simpler method? In this article, we will be looking at how you can use VS Code to debug a Node.js application.

It often involves putting console.log on every corner of your code. Integrated Terminal - Use the integrated terminal inside VS Code.Debugging Node.js code can prove challenging for many people.Debugging - Official documentation for VS Code debugging.Introductory Videos - Review the entire list of videos.

Version Control - Learn the basics of Git version control.Pick another video from the list: Introductory Videos Video outline Here's the next video we recommend: Version Control To follow along with the Python portion of the video, you'll need to install Python. Tip: To use the debugging features demonstrated in this video for Node.js, you will need to first install Node.js. We'll take a tour of the Run and Debug view, explore some debugging features, and end by setting a breakpoint. In this tutorial, we will show you how to run and debug a program in VS Code. Configure IntelliSense for cross-compilingĭebugging is a core feature of Visual Studio Code.
