title: Why cors module can not be found?
body: <p>I'm trying to enable <code>cors</code> for my next.js API.</p>
  <p>Based on <a href="https://nextjs.org/docs/api-routes/introduction#caveats" rel="nofollow noreferrer">docs</a> and <a href="https://github.com/vercel/next.js/blob/canary/examples/api-routes-cors/pages/api/cors.ts" rel="nofollow noreferrer">the example</a> I installed cors:</p>
  <pre><code>npm i cors
  </code></pre>
  <p>And I can verify that it's in my <code>package.json</code>:</p>
  <pre><code>&quot;cors&quot;: &quot;^2.8.5&quot;,
  </code></pre>
  <p>And it's in my <code>node_modules</code> directory.</p>
  <p>However, when I use <code>import Cors from 'cors'</code> in my api code, I get this error:</p>
  <blockquote>
  <p>Module not found: Can't resolve 'cors'</p>
  </blockquote>
  <p>Why do I get this error while the package is installed? I also tried <code>const cors = require('cors')</code> and got the same error.</p>