title: Property 'users' does not exist on type 'Global & typeof globalThis' although modifying global with global.d.ts
body: <p>I am trying to develop a project in the one I need to include global variables that could be accessed from anywhere. Normally, with javascript I would be able to write something like this: <code>global.users = {}</code> but this is not that easy in typescript, therefore, I need to modify the interface of the <code>global</code> variable. After some research I tried including in <code>global.d.ts</code> the following code:</p>
  <pre><code>// global.d.ts
  
  declare module NodeJS  {
      interface Global {
          users: {[key: string]: import(&quot;./src/server/classes/User&quot;).User}
      }
  }
  </code></pre>
  <p>Which actually made the VS Code Intellisense errors dissappear, but when I run <code>ts-node</code> the errors appear again:</p>
  <pre><code>TSError: ⨯ Unable to compile TypeScript:
  src/server/index.ts:22:8 - error TS2339: Property 'users' does not exist on type 'Global &amp; typeof globalThis'.
  
  global.users = {};
  </code></pre>