Languages
[Edit]
EN

VS Code - debug with npm run

7 points
Created by:
Aaron1
568

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

Simple steps

  1. configure .vscode/launch.json file:
    {
        "version": "0.2.0",
        "configurations": [
            {
                "name": "My Backend",
                "command": "npm run develop",
                "request": "launch",
                "type": "node-terminal"
            }
        ]
    }

    Hints:

    • change "command" value to the command you want to debug,
    • commands are available in package.json file in "scripts" part.
  2. go to Run and Debug view (or press Ctrl+Shift+d keys),
  3. select My Backend configuration,
  4. click Start Debugging button (or press F5 key).
Running debugger in VS Code.
Running debugger in VS Code.

See also

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

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

Alternative titles

  1. VSCode - debug with npm run
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

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