title: Nodejs with TypeScript gives weird errors
body: <p>I am using TypeScript 1.5.0-beta and I am using Visual Studio Code to create a simple Node Server using an example that Anders Hejlsberg showed at build.</p>
  
  <pre><code>///&lt;reference path="typings/node/node.d.ts"/&gt;
  
  import { createServer } from "http"
  
  export function simpleServer(port: number, message: string)
  {
    createServer((req, res) =&gt;
    {
      res.writeHead(200, {'Content-Type': 'text/plain'});
      res.end('Hello World\n');
    }).listen(port, '127.0.0.1');
  
    console.log('Server running at http://127.0.0.1:1337/');
  }
  </code></pre>
  
  <p>I have three issues</p>
  
  <p>1) With this code, whenever I try to build the ts file either using Visual Studio Code or the command $ tsc server -m commonjs, it keeps giving weird errors like these</p>
  
  <pre><code>error TS1008: Unexpected token; 'module
  , class, interface, enum, import or statement' expected
  </code></pre>
  
  <p>2) It also tries to build node.d.ts file that I am referencing and gives additional ":" expected error messages.</p>
  
  <p>3) This is more of a Visual Studio Code question. How do we get VS Code to build all ts files in a project/folder and generate js files.
  I followed the instructions for the typescript setup for VS Code but I still have to individually build each ts file to gen the js code. </p>
  
  <p>I know grunt is one way to do it but as far as I know VS Code should be able to build all ts files in a folder like Visual Studio does. Please correct me if I am wrong.</p>
  
  <p>Thanks.</p>