Getting started with Node.js debugging in VS Code

Visual Studio Code · 511K views · 2018 · 8:04

Open on YouTube

Testing, debugging & developer toolsWeb developmenttutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering questions about VS Code breakpoints, launch.json setups and attaching the debugger to a Node process.

Recommended by 2 people across 2 different months, 2018 to 2020.

What it is

A short official walkthrough from the Visual Studio Code channel on debugging Node.js applications in VS Code. It covers the basics of setting breakpoints, launching a program under the debugger, and attaching to a running Node process.

What people said

Recommends deerawan · 2018-07 · Stack Overflow · on “Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test”

perhaps you can try to set some breakpoint and debugging the code when the test is running before and after adding that schema to see the differences. [this video]

Recommends ETdecode · 2020-07 · Stack Overflow · on “Debugging Vue in VScode and Chrome, unbound breakpoint”

What if you select `attach to process` instead of program? In my case I can now put a breakpoint. Let me know if it helps if you have the issue. YT_vscode_debug [this video]

Cites Michael · 2018-11 · Stack Overflow · on “Why is VSCode debugger not finding Node process to attach to?”

I'm testing out the VS Code node debugger, but I'm not able to find any node processes when trying to attach to a running process. This is my launch.json file: { "version": "0.2.0", "configurations": [ { "type": "node", "request": "attach", "name": "Attach by Process ID", "processId": "${command:PickProcess}" } ] } the contents of my package.json file: "scripts": { "start": "node --inspect=0.0.0.0:9229 ./bin/www" } After I start up the process using 'npm start', I press 'start debug' and the list of node processes is: 1 sssd_pam 1 sssd_nss 1 sssd_be Looks like this [LINK] and none of these are the server I just launched. This list persists even after I take down the node server. Why am I not