title: Typescript module, require external node_modules
body: <p>I need to use a simple node_module inside a simple typescript file, but it seems that the compiler doesn't want to get it.</p>
  
  <p>Here's my simple ts file :</p>
  
  <pre><code>import glob = require('glob');
  console.log(glob);
  </code></pre>
  
  <p>And I've got this error :</p>
  
  <pre><code>[13:51:11] Compiling TypeScript files using tsc version 1.5.0
  [13:51:12] [tsc] &gt; F:/SkeletonProject/boot/ts/Boot.ts(4,23): error TS2307: Cannot find external module 'glob'.
  [13:51:12] Failed to compile TypeScript: Error: tsc command has exited with code:2
  
  events.js:72
          throw er; // Unhandled 'error' event
                ^
  Error: Failed to compile: tsc command has exited with code:2
  
  npm ERR! skeleton-typescript-name@0.0.1 start: `node compile &amp;&amp; node ./boot/js/Boot.js`
  npm ERR! Exit status 8
  npm ERR!
  npm ERR! Failed at the skeleton-typescript-name@0.0.1 start script.
  </code></pre>
  
  <p>However, when I use a simple declaration in this same script, it works :</p>
  
  <pre><code>var x = 0;
  console.log(x); // prints  0 after typescript compilation
  </code></pre>
  
  <p>What am I doing wrong in this case ?</p>
  
  <p>EDIT: </p>
  
  <p>Here's my gulp file :</p>
  
  <pre><code>var gulp = require('gulp');
  var typescript = require('gulp-tsc');
  
  
  gulp.task('compileApp', ['compileBoot'], function () {
      return gulp.src(['app/src/**/*.ts'])
          .pipe(typescript())
          .pipe(gulp.dest('app/dist/'))
  });
  
  gulp.task('compileBoot', function () {
      return gulp.src(['boot/ts/*.ts'])
          .pipe(typescript({
              module:'commonjs'
          }))
          .pipe(gulp.dest('boot/js/'))
  });
  
  gulp.start('compileApp');
  </code></pre>
  
  <p>Thanks for advance</p>
  
  <p>Thanks for advance</p>