title: Importing node-modules with TypeScript
body: <p>I'm trying to get this to work, but I can't seem to find a solution anywhere on SO. When trying to compile this single-file app:</p>
  
  <pre><code>import http = require('http')
  http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Hello World\n');
  }).listen(1337, '127.0.0.1');
  console.log('Server running at http://127.0.0.1:1337/');
  </code></pre>
  
  <p>Using the command "tsc app.ts --module 'commonjs'" I get the following error (not using the --module flag gives me an additional error telling me that I need it to compile external modules):</p>
  
  <pre><code>error TS2071: Unable to resolve external module '"http"'.
  error TS2072: Module cannot be aliased to a non-module type.
  </code></pre>