title: Cannot find module 'mongoose' with typeScript
body: <p>I want to use await in a top-level function, and to do that typeScript requests me to put my target language in the tsconfig.json to 2017 or higher and the module to es2022. But when I do that, there is this error: &quot;Cannot find module 'mongoose'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?&quot;</p>
  <p>I have already searched in a lot of places but I did not find a solution for that.</p>
  <p>Here is some of my code:</p>
  <p>The tsconfig.json</p>
  <pre><code>{
  &quot;compilerOptions&quot;: {
   &quot;target&quot;: &quot;es2022&quot;,   
  &quot;module&quot;: &quot;es2022&quot;,
  &quot;outDir&quot;: &quot;./build&quot;,     
  &quot;esModuleInterop&quot;: true,   
   &quot;forceConsistentCasingInFileNames&quot;: true,
   &quot;strict&quot;: true,  
  &quot;skipLibCheck&quot;: true 
  }
  }
  </code></pre>
  <p>package.json</p>
  <pre><code>{
    &quot;name&quot;: &quot;finanzas&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;API que permite gestionar las finanzas de un nucleo familiar o individuo&quot;,
    &quot;main&quot;: &quot;index.js&quot;,
    &quot;scripts&quot;: {
      &quot;dev&quot;: &quot;ts-node-dev src/index.ts&quot;,
      &quot;start&quot;: &quot;node build/index.js&quot;,
      &quot;tsc&quot;: &quot;tsc&quot;,
      &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;
    },
    &quot;keywords&quot;: [],
    &quot;author&quot;: &quot;Andres Felipe Cuervo&quot;,
    &quot;license&quot;: &quot;ISC&quot;,
    &quot;devDependencies&quot;: {
      &quot;@types/express&quot;: &quot;^4.17.13&quot;,
      &quot;@types/mongoose&quot;: &quot;^5.11.97&quot;,
      &quot;@types/node&quot;: &quot;^17.0.44&quot;,
      &quot;dotenv&quot;: &quot;^16.0.1&quot;,
      &quot;ts-node-dev&quot;: &quot;^2.0.0&quot;,
      &quot;typescript&quot;: &quot;^4.7.3&quot;
    },
    &quot;dependencies&quot;: {
      &quot;express&quot;: &quot;^4.18.1&quot;,
      &quot;mongoose&quot;: &quot;^6.3.8&quot;
    }
  }
  </code></pre>
  <p>And the error occurs when I import mongoose like this:</p>
  <pre><code>import mongoose from &quot;mongoose&quot;;
  </code></pre>
  <p>if I imported it with require there is no error</p>