title: vscode can't launch node app
body: <p>I'm trying to set up a typescript-based express app workflow using Visual Studio Code &amp; gulp.</p>
  
  <p>Heres my project structure:</p>
  
  <pre><code>src/  &lt;-- souce files
    Start.ts
    Server.ts
    models/
      Contact.ts
      Organization.ts
  bin/  &lt;-- compiled output
    Start.js 
    Start.js.map
    ...
  tsconfig.json
  gulpfile.json
  package.json
  .vscode/
    launch.json
  </code></pre>
  
  <p>Performing the following sequence of commands, I can compile &amp; launch my app in the integrated terminal:</p>
  
  <pre><code>&gt; tsc
  &gt; node --debug-brk ./bin/Start.js
  </code></pre>
  
  <p>At this point, I can successfully attach to my app using the default "attach to process" command (and it even hits breakpoints in the typescript files correctly, yeyy!):</p>
  
  <pre><code>{
      "type": "node",
      "request": "attach",
      "name": "Attach to Process",
      "address": "localhost",
      "port": 5858
  }
  </code></pre>
  
  <p><em>However</em>, <strong>launching with <code>F5</code> fails every time</strong>. There is no output on the Debug Console, and in a few seconds I get an error banner at the top saying <code>Cannot connect to runtime via 'legacy' protocol; consider using 'inspector' protocol (timeout after 10000 ms).</code></p>
  
  <p>Here's my launch configuration (in launch.json):</p>
  
  <pre><code>{
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
  
      // Using compiled .js file. vscode should use the sourcemap to correlate
      // with breakpoints in the source file
      "program": "${workspaceRoot}/bin/Start.js",
      "outFiles": [ "${workspaceRoot}/bin/**/*.js" ]
  }
  </code></pre>
  
  <p><strong>I tried opening the debug console</strong>. Every time I save the launch.json file, it gives me the following error: <code>Cannot read property '_runner' of undefined: TypeError: Cannot read property '_runner' of undefined</code> in <code>shell.ts:426</code></p>
  
  <p>Googling the error, I came across <a href="https://github.com/Microsoft/vscode/issues/22606" rel="nofollow noreferrer">this bug</a></p>
  
  <p>What does this bug mean? Is there any workaround for it? What oh what should I do???</p>