title: TypeScript: How can I get a clean compile?
body: <p>I hope this is simple!</p>
  
  <p><code>TypeScript</code> Version 1.9.0-dev.20160512 (available from <code>npm install -g typescript@next</code> and recommended by @basarat)
  <code>Node</code> v5.11.0
  <code>Windows</code> 10.0.10586</p>
  
  <p>file 1, u1c.ts</p>
  
  <pre><code>import * as u1u from "./u1u.ts"
  let p = u1u.Promise
  console.log(`from u1c.ts`)
  </code></pre>
  
  <p>file 2, u1u.ts</p>
  
  <pre><code>console.log(`from u1u.ts`)    
  export let Promise = require(`bluebird`) //http://bluebirdjs.com
  </code></pre>
  
  <p>file 3, tsconfig.json (<strong>relevant part only</strong>); I want to write in ES6 and get output in ES3 (on the presumption that all browsers out there will know about it).</p>
  
  <pre><code>{
      "compileOnSave": true,
      "complierOptions": {
          "lib": "ES6",
          "target": "ES3"
      }
  }
  </code></pre>
  
  <p>result 1</p>
  
  <pre><code>&gt;tsc u1c.ts
  u1u.ts(2,22): error TS2304: Cannot find name 'require'.
  </code></pre>
  
  <p>Can't find "require"? Sounds like it doesn't know about Node.js. Let's teach it! <code>typings</code> gives me access to a fifth version of node.d.ts last changed 2016-05-09; I pulled it in and pointed at it.</p>
  
  <p>new u1u.ts</p>
  
  <pre><code>/// &lt;reference path="./typings/node/node.d.ts" /&gt;  // &lt;==== new line, only change
  console.log(`from u1u.ts`)    
  export let Promise = require(`bluebird`) //http://bluebirdjs.com
  </code></pre>
  
  <p>result 2 (same as result 1)</p>
  
  <pre><code>&gt;tsc u1c.ts
  u1u.ts(2,22): error TS2304: Cannot find name 'require'.
  </code></pre>
  
  <p>I'm out of ideas. How can I get a clean compile?</p>
  
  <p>Thanks in advance for any time and ideas you offer!</p>