title: TypeScript - module.exports throws error TS2591: Cannot find name 'module'
body: <p>I have a file called <code>config.ts</code> which contains following code:</p>
  
  <pre><code>let config = {
    foo: {
      bar: [{env: "test"}...],
      ...
      ...
    }
  };
  
  module.exports = config;
  </code></pre>
  
  <p>I'd like to use this file application-wide.</p>
  
  <p>However, this code results in the following error: </p>
  
  <pre><code>ERROR in src/app/configs/config.ts:357:1 - error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
  
  357 module.exports = config;
  </code></pre>
  
  <p>I have checked that I have <code>@types/node</code> installed and <code>tsconfig.json</code> file contains <code>"types": ["node"]</code> under <code>compilerOptions</code>.</p>
  
  <p>How can this issue be resolved?</p>