title: Trying to setup firebase custom claims and I keep getting an error
body: <p>I ran <code>firebase init</code> in powershell (inbuilt vscode term) and did its thing, i selected TypeScript, and it generated the files. I also installed dependencies in the script.</p>
  <p>However,
  I tried to run this code in an index.ts file and it threw the accompanied error:</p>
  <pre class="lang-js prettyprint-override"><code>import * as functions from 'firebase-functions';
  import * as admin from 'firebase-admin';
  
  admin.initializeApp();
  
  async function grantModeratorRole(email: string): Promise&lt;void&gt; {
      const user = await admin.auth().getUserByEmail(email);
      if (user.customClaims &amp;&amp; (user.customClaims as any).moderator) {
          return;
      }
      return admin.auth().setCustomUserClaims(user.uid, { 
          moderator: true 
      });
  }
  
  grantModeratorRole(&quot;bearcodes@outlook.com&quot;);
  
  </code></pre>
  <p>(the call of the function is a test for the time being)</p>
  <p>The error is:</p>
  <pre><code>node:internal/modules/cjs/loader:361
        throw err;
        ^
  
  Error: Cannot find module 'C:\Users\bearc\Documents\WebstormProjects\SimsRedux\functions\lib\index.js'. Please verify that the package.json has a valid &quot;main&quot; entry
      at tryPackage (node:internal/modules/cjs/loader:353:19)
      at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
      at resolveMainPath (node:internal/modules/run_main:15:25)
      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:73:24)
      at node:internal/main/run_main_module:17:47 {
    code: 'MODULE_NOT_FOUND',
    path: 'C:\\Users\\bearc\\Documents\\WebstormProjects\\SimsRedux\\functions\\package.json',
    requestPath: 'C:\\Users\\bearc\\Documents\\WebstormProjects\\SimsRedux\\functions'
  }
  </code></pre>
  <p>Thanks in advance!</p>