title: Error importing node modules in TypeScript
body: <p>I had a problem this morning that was driving me crazy.  I'll explain the issue and then I'll provide my answer below (so that others who come across this can get to a solution sooner).</p>
  
  <p>It is very easy to duplicate the issue by just issuing these commands:</p>
  
  <pre><code>tsd query react --action install
  mkdir src
  echo "import React = require('react');" &gt; src/foo.ts
  </code></pre>
  
  <p>I also included the following <code>tsconfig.json</code> file in <code>src</code>:</p>
  
  <pre><code>{
      "version": "1.6.2",
      "compilerOptions": {
          "outDir": "./tsdir",
          "target": "es5",
          "module": "commonjs",
          "moduleResolution": "node",
          "isolatedModules": false,
          "jsx": "react",
          "experimentalDecorators": true,
          "emitDecoratorMetadata": true,
          "declaration": true,
          "noImplicitAny": false,
          "removeComments": true,
          "noLib": false,
          "preserveConstEnums": true,
          "suppressImplicitAnyIndexErrors": true
      },
      "files": [
          "foo.ts"
      ]
  }
  </code></pre>
  
  <p>If I try to compile this by simply running the <code>tsc</code> (version 1.6.2) command inside <code>src</code>, I get:</p>
  
  <pre><code>foo.ts(1,24): error TS2307: Cannot find module 'react'.
  </code></pre>
  
  <p>What I find baffling here is that I've installed the <code>react</code> bindings with <code>tsd</code> but when I run <code>tsc</code>, I get this error.  It looks like I've done everything right, so why the error?</p>