Languages
[Edit]
EN

VS Code - debug with npm run

7 points
Created by:
Aaron1
318

In this short article, we would like to show you how to debug with Node.js application that starts with npm run with VS Code.

Example .vscode/launch.json config file:

{
    "version": "0.2.0",
    "configurations": [
        {
            "command": "npm run develop",
            "name": "My Backend",
            "request": "launch",
            "type": "node-terminal"
        }
    ]
}

Hint:
Change "command" value to the command you want to debug (you can find commands in package.json in "scripts" part).

e.g.

"command": "npm run build"

let's in preact project to to handle breakpoint in preact.config.js file during application building and debug it - useful when custom configuration is needed.

See also

  1. VS Code - debug js file with Node.js

  2. VS Code - debug Gatsby React project in IDE on Ubuntu

Visual Studio Code

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join