title: Debugging nest.js application with vscode
body: <p>I am testing the nest.js framework but I am struggling to run it with VSCode so that I can properly debug my code. This is pretty much the same issue as described here <a href="https://stackoverflow.com/questions/44078305/running-nest-js-from-vs-code">Running nest.js from VS Code</a>. However I made sure I am using the latest packages. I always get this error:</p>
  
  <pre><code>Error: Cannot find module 'cats/cats.module'
      at Function.Module._resolveFilename (module.js:485:15)
      at Function.Module._load (module.js:437:25)
      at Module.require (module.js:513:17)
      at require (internal/module.js:11:18)
      at Object.&lt;anonymous&gt; (c:\Users\user\Documents\random-api\dist\app.module.js:11:26)
      at Module._compile (module.js:569:30)
      at Object.Module._extensions..js (module.js:580:10)
      at Module.load (module.js:503:32)
      at tryModuleLoad (module.js:466:12)
      at Function.Module._load (module.js:458:3)
  </code></pre>
  
  <p><code>npm run start</code> works completely perfect, but I want to debug the application with the VSCode IDE.</p>
  
  <p><strong>My package.json dependencies:</strong></p>
  
  <pre><code>  "dependencies": {
      "@nestjs/common": "^4.6.6",
      "@nestjs/core": "^4.6.6",
      "@nestjs/microservices": "^4.6.6",
      "@nestjs/testing": "^4.6.6",
      "@nestjs/websockets": "^4.6.6",
      "reflect-metadata": "^0.1.12",
      "rxjs": "^5.5.7",
      "typescript": "^2.7.2"
    },
    "devDependencies": {
      "@types/express": "^4.11.1",
      "@types/jest": "^22.2.2",
      "@types/node": "^9.6.0",
      "@types/supertest": "^2.0.4",
      "jest": "^22.4.3",
      "nodemon": "^1.17.2",
      "prettier": "^1.11.1",
      "supertest": "^3.0.0",
      "ts-jest": "^22.4.2",
      "ts-node": "^5.0.1",
      "tsconfig-paths": "^3.1.3",
      "tslint": "5.9.1",
      "tslint-microsoft-contrib": "^5.0.3"
    },
  </code></pre>
  
  <p><strong>My vscode's launch.json:</strong></p>
  
  <pre><code>{
      "version": "0.2.0",
      "configurations": [
          {
              "type": "node",
              "request": "launch",
              "name": "Launch Program",
              "program": "${workspaceFolder}\\dist\\main.js",
              "smartStep": true,
              "outFiles": [
                  "${workspaceFolder}/dist/**/*.js"
              ]
          }
      ]
  }
  </code></pre>
  
  <p>I tried the same launch.json with the typescript file as path, but that threw the same exception:</p>
  
  <pre><code>"program": "${workspaceFolder}\\src\\main.ts",
  </code></pre>