title: TypeScript + moment.js: error TS2307: Cannot find module 'moment'
body: <p>I'm developing a web app, using angular 1.5, typescript 2.4.0, moment: 2.18.1, and gulp for project assembling.</p>
  
  <p>Here is my <code>tsconfig.json</code>:</p>
  
  <pre><code>{
    "files": [
      "src/app/main.ts",
      "types/**/*.ts"
    ],
    "compilerOptions": {
      "noImplicitAny": false,
      "target": "es2015",
      "allowSyntheticDefaultImports": true
    }
  }
  </code></pre>
  
  <p>Inside my <code>date-range-picker.component.ts</code>. I'm importing moment lib, as was proposed in the <a href="https://momentjs.com/docs/#/use-it/typescript/" rel="noreferrer">main documentation</a>:</p>
  
  <pre><code>import * as moment from 'moment'; 
  </code></pre>
  
  <p>Which works fine for the main gulp project assembling task that relies on tsify plugin.:</p>
  
  <pre><code>var browserifyIt = browserify({
      basedir: '.',
      debug: true,
      entries: paths.browserifyEntries,
      cache: {},
      packageCache: {}
  }).plugin(tsify);
  
  gulp.task('bundle', ['views'], function () {
      return browserifyIt
          .transform('babelify', {
              presets: ['es2015'],
              extensions: ['.ts']
          })
          .bundle()
          .on('error', interceptErrors)
          .pipe(source(fileNames.buildJs))
          .pipe(ngAnnotate())
          .pipe(buffer())
          .pipe(sourcemaps.init({loadMaps: true}))
          .pipe(sourcemaps.write(paths.sourcemapPath))
          .pipe(gulp.dest(paths.build));
  });
  </code></pre>
  
  <p>But for the compiling of the tests I decided to use task employing tsProject():</p>
  
  <pre><code>const testSrcPaths = {
      ....,
      componentTests: 'src/app/components/**/*.test.ts',
      ....
  };
  gulp.task('component-tests:compile', function () {
         return gulp.src(testSrcPaths.componentTests).pipe(tsProject())
          .on('error', interceptErrors)
          .js.pipe(gulp.dest(`${paths.testsDist}/components`));
  });
  </code></pre>
  
  <p>Which leads to the following error:</p>
  
  <blockquote>
    <p>date-range-picker/date-range-picker.component.ts(2,25): error TS2307:
    Cannot find module 'moment'.</p>
  </blockquote>
  
  <p>What can be done to fix it?</p>