title: TypeScript / Webpack (Tutorial fail) typings errors on node_modules
body: <p>I am trying to get compiled TypeScript code (.tsx -> .js) to package up with Webpack so I can do some front-end work and run the code in the browser. (I actually have some more requirements, like needing to share some front-end (browser) TypeScript code with the Node.js server and running all of this stuff inside of Electron, but those are secondary.)</p>
  
  <p>I just followed this tutorial:</p>
  
  <ul>
  <li><a href="https://www.typescriptlang.org/docs/handbook/react-&amp;-webpack.html" rel="nofollow noreferrer">https://www.typescriptlang.org/docs/handbook/react-&amp;-webpack.html</a></li>
  </ul>
  
  <p>And when I typed <code>webpack</code> at the end I got 1000+ errors (truncated):</p>
  
  <pre><code>$ webpack
  
  [at-loader] Using typescript@2.1.4 from typescript and "tsconfig.json" from /Users/jupdike/Documents/dev/tsrw/proj/tsconfig.json.
  
  
  [at-loader] Checking started in a separate process...
  
  [at-loader] Checking finished with 1065 errors
  Hash: 7aedcf2d5d64f9ada335
  Version: webpack 1.14.0
  Time: 3264ms
          Asset     Size  Chunks             Chunk Names
      bundle.js  2.94 kB       0  [emitted]  main
  bundle.js.map  3.04 kB       0  [emitted]  main
      + 4 hidden modules
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/dist/test/utils.d.ts:3:24 
      Cannot find module 'chai'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/dist/test/utils.d.ts:25:50 
      Parameter 'err' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/dist/test/utils.d.ts:25:55 
      Parameter 'stats' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/lib/runtime.d.ts:20:13 
      Subsequent variable declarations must have the same type.  Variable 'require' must be of type 'NodeRequire', but here has type 'WebpackRequire'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/cache.ts:43:23 
      Argument of type 'Buffer' is not assignable to parameter of type 'string'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/cache.ts:66:35 
      Parameter 'identifier' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/cache.ts:66:47 
      Parameter 'options' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/checker/checker.ts:1:20 
      Could not find a declaration file for module 'lodash'. '/Users/jupdike/Documents/dev/tsrw/proj/node_modules/lodash/lodash.js' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/checker/runtime.ts:2:47 
      Parameter 'err' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/checker/runtime.ts:17:20 
      Parameter 'msg' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/checker/runtime.ts:30:28 
      Parameter 'cb' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/checker/runtime.ts:41:25 
      Cannot find module 'colors'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/checker/runtime.ts:195:13 
      Parameter 'message' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/checker/runtime.ts:199:20 
      Rest parameter 'args' implicitly has an 'any[]' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/checker/runtime.ts:203:18 
      Rest parameter 'args' implicitly has an 'any[]' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/checker/runtime.ts:207:23 
      Rest parameter 'args' implicitly has an 'any[]' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/checker/runtime.ts:219:24 
      Rest parameter 'args' implicitly has an 'any[]' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/checker/send.ts:15:9 
      Variable 'msgQueue' implicitly has type 'any[]' in some locations where its type cannot be determined.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/checker/send.ts:20:13 
      Variable 'msgQueue' implicitly has an 'any[]' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/checker/send.ts:24:45 
      Parameter 'error' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/checker/send.ts:32:17 
      Variable 'msgQueue' implicitly has an 'any[]' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/checker/send.ts:33:38 
      Variable 'msgQueue' implicitly has an 'any[]' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/helpers.ts:19:21 
      Parameter 'fileName' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/helpers.ts:19:31 
      Parameter 'outputFileName' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/helpers.ts:19:47 
      Parameter 'sourceFileName' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/helpers.ts:25:26 
      Parameter 'fileName' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/helpers.ts:25:36 
      Parameter 'outputFileName' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/helpers.ts:25:52 
      Parameter 'sourceFileName' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/helpers.ts:31:28 
      Parameter 'fileName' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/helpers.ts:31:38 
      Parameter 'outputFileName' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/helpers.ts:31:54 
      Parameter 'sourceFileName' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/helpers.ts:64:36 
      Parameter 'errors' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/helpers.ts:66:24 
      Parameter 'error' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/helpers.ts:72:29 
      Parameter 'diagnostic' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/helpers.ts:105:32 
      Parameter 'lineChar' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/helpers.ts:109:25 
      Parameter 'moduleId' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/index.ts:3:20 
      Could not find a declaration file for module 'lodash'. '/Users/jupdike/Documents/dev/tsrw/proj/node_modules/lodash/lodash.js' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/index.ts:14:17 
      Parameter 'text' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:3:20 
      Could not find a declaration file for module 'lodash'. '/Users/jupdike/Documents/dev/tsrw/proj/node_modules/lodash/lodash.js' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:49:10 
      'getRootCompiler' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:49:26 
      Parameter 'compiler' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:57:27 
      Parameter 'compiler' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:66:30 
      Parameter 'compiler' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:73:26 
      Parameter 'compiler' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:73:36 
      Parameter 'instanceName' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:141:10 
      'findTsImplPackage' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:246:21 
      Parameter 'fileName' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:299:24 
      Parameter 'compiler' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:300:44 
      Parameter 'watching' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:300:54 
      Parameter 'callback' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:339:28 
      Parameter 'compiler' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:339:38 
      Parameter 'instanceName' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:340:48 
      Parameter 'compilation' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:340:61 
      Parameter 'callback' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:352:26 
      Parameter 'msg' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:367:21 
      Binding element 'files' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:374:23 
      Parameter 'diags' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/instance.ts:375:35 
      Parameter 'diag' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/paths-plugin.ts:4:20 
      Could not find a declaration file for module 'lodash'. '/Users/jupdike/Documents/dev/tsrw/proj/node_modules/lodash/lodash.js' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/paths-plugin.ts:36:5 
      'plugin', which lacks return-type annotation, implicitly has an 'any' return type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/paths-plugin.ts:37:5 
      'doResolve', which lacks return-type annotation, implicitly has an 'any' return type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/paths-plugin.ts:37:59 
      Parameter 'Callback' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/paths-plugin.ts:48:23 
      Parameter 'str' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/paths-plugin.ts:117:17 
      Parameter 'request' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/paths-plugin.ts:117:26 
      Parameter 'callback' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/babel.ts:6:1 
      Cannot find name 'describe'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/babel.ts:8:5 
      Cannot find name 'it'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/babel.ts:32:5 
      Cannot find name 'it'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/declaration.ts:6:1 
      Cannot find name 'describe'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/declaration.ts:8:5 
      Cannot find name 'xit'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/fixtures/babel/babel.ts:1:7 
      Duplicate identifier 'HiThere'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/fixtures/basic/basic.ts:1:7 
      Duplicate identifier 'HiThere'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/fixtures/errors/with-type-errors.ts:3:26 
      Argument of type 'number' is not assignable to parameter of type 'boolean'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/fixtures/salsa/index.ts:1:21 
      Module './lib' was resolved to '/Users/jupdike/Documents/dev/tsrw/proj/node_modules/awesome-typescript-loader/src/test/fixtures/salsa/lib.js', but '--allowJs' is not set.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/fixtures/typeRoots/index.ts:2:1 
      Cannot find name 'describe'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/index.ts:6:1 
      Cannot find name 'describe'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/index.ts:8:5 
      Cannot find name 'it'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/index.ts:23:5 
      Cannot find name 'it'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/index.ts:32:5 
      Cannot find name 'it'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/index.ts:43:5 
      Cannot find name 'it'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/index.ts:54:45 
      Object literal's property 'configFileContent' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/react.ts:6:1 
      Cannot find name 'describe'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/react.ts:7:5 
      Cannot find name 'it'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/salsa.ts:6:1 
      Cannot find name 'describe'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/salsa.ts:7:5 
      Cannot find name 'it'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/salsa.ts:13:45 
      Object literal's property 'configFileContent' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/salsa.ts:19:5 
      Cannot find name 'xit'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/salsa.ts:25:45 
      Object literal's property 'configFileContent' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/typeRoots.ts:6:1 
      Cannot find name 'describe'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/typeRoots.ts:7:5 
      Cannot find name 'it'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:5:20 
      Could not find a declaration file for module 'lodash'. '/Users/jupdike/Documents/dev/tsrw/proj/node_modules/lodash/lodash.js' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:12:24 
      Cannot find module 'chai'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:38:30 
      Parameter 'conf' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:70:9 
      Object literal's property 'plugins' implicitly has an 'any[]' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:108:36 
      Parameter 'buf' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:118:15 
      Parameter 'buf' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:119:15 
      Parameter 'source' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:127:76 
      Parameter 'buf' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:135:33 
      Parameter 'config' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:140:25 
      Parameter 'config' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:143:23 
      Parameter 'err' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:143:28 
      Parameter 'stats' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:153:23 
      Parameter 'config' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:153:37 
      Parameter 'err' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:153:42 
      Parameter 'stats' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:156:46 
      Parameter 'err' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:156:51 
      Parameter 'stats' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:171:10 
      Parameter 'err' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/utils.ts:171:15 
      Parameter 'stats' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/watch-type-errors.ts:5:1 
      Cannot find name 'describe'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/watch-type-errors.ts:23:5 
      Cannot find name 'it'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/without-sourcemap.ts:6:1 
      Cannot find name 'describe'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/test/without-sourcemap.ts:7:5 
      Cannot find name 'it'.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/watch-mode.ts:4:11 
      Parameter 'compiler' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/watch-mode.ts:5:41 
      Parameter 'params' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/watch-mode.ts:5:49 
      Parameter 'callback' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/watch-mode.ts:10:47 
      Parameter 'params' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/awesome-typescript-loader/src/watch-mode.ts:10:55 
      Parameter 'callback' implicitly has an 'any' type.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:1:1 
      File '/Users/jupdike/Documents/dev/tsrw/proj/node_modules/typescript/scripts/types/ambient.d.ts' not found.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:5:31 
      Cannot find module 'gulp'.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:6:28 
      Cannot find module 'gulp-help'.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:7:30 
      Cannot find module 'run-sequence'.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:8:25 
      Cannot find module 'gulp-concat'.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:9:24 
      Cannot find module 'gulp-clone'.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:10:24 
      Cannot find module 'gulp-newer'.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:11:22 
      Cannot find module 'gulp-typescript'.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:12:16 
      Invalid module name in augmentation, module 'gulp-typescript' cannot be found.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:21:25 
      Cannot find module 'gulp-insert'.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:22:29 
      Cannot find module 'gulp-sourcemaps'.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:23:20 
      Cannot find module 'q'.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:26:10 
      Duplicate identifier 'Promise'.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:28:22 
      Cannot find module 'del'.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:29:25 
      Cannot find module 'mkdirp'.
  
  ERROR in [at-loader] node_modules/typescript/Gulpfile.ts:30:27 
      Could not find a declaration file for module 'minimist'. '/Users/jupdike/node_modules/minimist/index.js' implicitly has an 'any' type.
  </code></pre>
  
  <p>Are there any other tutorials or skeletons/bootstrap downloads that will help me set up a test project in the manner I have described? Or is there a way to tweak this tutorial so that it works as expected instead of being worse than trying to just follow one of the Webpack tutorials? It seems like the awesome-typescript-loader plugin is anything but.</p>
  
  <p>(As an aside, am I just crazy or is the JS/Node ecosystem like the "Wild West (or "Let 1,000 flowers bloom", depends on your perspective). All these tools that are supposed to make JS dev more convenient and powerful have a really high upfront complexity cost, with infinite flexibility yet they require a lot of yak-shaving. Am I alone in this?)</p>