NestJS: VSCode debugger setup

Debugging is inevitable for all developers and when you get the point that your code is not doing what you would expect

VSCode is definitely built for TypeScript and thus perfect for NestJS. Get started by ensuring you have VSCode installed and open your project in VSCode. For the purpose of this article install the Nest TypeScript starter scaffolding.

    $ npm i -g @nestjs/cli
    $ nest new my-app

Create a launch.json file:

        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit:
        "version": "0.2.0",
        "configurations": [
                "type": "node",
                "request": "launch",
                "name": "Launch Program",
                "skipFiles": [
                "program": "${workspaceFolder}/src/main.ts",
                "preLaunchTask": "tsc: watch -",
                "outFiles": [

Now you can set breakpoints and Debug -> Start Debugging or press F5.

Since you've made it this far, sharing this article on your favorite social media network would be highly appreciated 💖!

For feedback, please ping me on Mastodon @[email protected] .