Cannot find namespace NodeJS after webpack upgrade : <p>I have Angular2 application that is built with WebPack. I upgraded WebPack from v1.8 to v2, and everything seems to be working fine. The only problem is that the old code has the following:</p>

<pre><code>import Timer = NodeJS.Timer;
....
apptInterval: Timer;
....
this.apptInterval = setInterval(() =&gt; { ... }, 1000);
</code></pre>

<p>After the upgrade this gives me an error: <code>TS2503: Cannot find namespace 'NodeJS'.</code></p>

<p>tsconfig.json looks like this:</p>

<pre><code>{
"compilerOptions": {
   "target": "es5",
   "module": "commonjs",
   "moduleResolution": "node",
   "sourceMap": true,
   "emitDecoratorMetadata": true,
   "experimentalDecorators": true,
   "lib": ["es2015", "dom"],
   "noImplicitAny": true,
   "suppressImplicitAnyIndexErrors": true
   }
}
</code></pre>

<p>The docs for Angular/Webpack no longer have <code>typings.json</code>; however, even if I copy from Webpack 1 directory, it doesn't help. The content is typings.json is</p>

<pre><code>{
"globalDependencies": {
  "jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
  "node": "registry:dt/node"
  }
}
</code></pre>

<p>Interesting that if I remove references to NodeJS, everything works fine. Like this:</p>

<pre><code>apptInterval: any;
....
this.apptInterval = setInterval(() =&gt; { ... }, 1000);
</code></pre>

<p>If I look under F12 debugger, the type of apptInterval is <code>ZoneTask</code>. I am sure there is a way to make it strong-typed, but it escapes me. The only suggestion I found was to run <code>typings install dt~node --global --save-dev</code> (which essentially updates typings.json, but doesn't help.</p>
