Beards, Bytes and Brews

bytes of thought by Daniel Tucker

NestJS: VSCode debugger setup

March 24, 2020 Code

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.