

cwd - launch the program to debug in this directory.This attribute is of type array and expects individual arguments as array elements. args - arguments passed to the program to debug.program - an absolute path to the Node.js program to debug.These attributes are only available for launch configurations of request type launch: skipFiles - automatically skip files covered by these glob patterns.
#Debug node js visual studio code code
smartStep- try to automatically step over code that doesn't map to source files.stopOnEntry - break immediately when the program launches.timeout - when restarting a session, give up after this number of milliseconds.resolveSourceMapLocations - an array of glob patterns for locations where source maps should be parsed.outFiles - array of glob patterns for locating generated JavaScript files.The following attributes are supported in launch configurations of type launch and attach: You can view the complete set of options in the vscode-js-debug options documentation. An introduction into the creation and use of debugging configuration files is in the general Debugging article.īelow is a reference of common launch.json attributes specific to the Node.js debugger. Launch configuration attributesĭebugging configurations are stored in a launch.json file located in your workspace's. Note: If you are just getting started with VS Code, you can learn about general debugging features and creating launch.json configuration files in the Debugging topic. If you'd like to watch an introductory video, see Getting started with Node.js debugging. You'll find instruction for debugging with source maps, stepping over external code, doing remote debugging, and much more.

In this section we'll go into more detail about configurations and features for more advanced debugging scenarios. Launch configs are the traditional way to set up debugging in VS Code, and provide you the most configuration options for running complex applications. For example, to add node internals to your skipFiles, you could add the following to your user or workspace settings: "" :, Launch Configuration You can apply other properties normally found in launch.json to auto attach in the setting. Temporarily turning off auto attach is useful if you're running some one-off programs where you don't need debugging, but you don't want to disable the feature entirely. Clicking it allows you to change the auto attach mode, or temporarily turn it off. When auto attach is on, the Auto Attach item will appear in the status bar across the bottom of the VS Code window. Then, the debugger should attach to your program within a second: This can be done by clicking the ⚠ icon in the top right of the terminal, or just creating a new one.

To enable the feature, either use the Toggle Auto Attach command from the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P)) or, if it's already activated, use the Auto Attach Status bar item. If the Auto Attach feature is enabled, the Node debugger automatically attaches to certain Node.js processes that have been launched from VS Code's Integrated Terminal. Use a launch config to start your program, or attach to a process launched outside of VS Code.Use the JavaScript debug terminal, similar to using the integrated terminal.Use auto attach to debug processes you run in VS Code's integrated terminal.There are a few ways you can debug your Node.js programs in VS Code: Setting up a project for Node.js debugging is straightforward with VS Code providing appropriate launch configuration defaults and snippets. The Visual Studio Code editor has built-in debugging support for the Node.js runtime and can debug JavaScript, TypeScript, and many other languages that are transpiled into JavaScript. Configure IntelliSense for cross-compiling.
