Cannot find module '@next/env' Next-js Vercel

Viewed 1922

I have developed a Next.js app that works fine on my local machine. I am trying to deploy my app on Vercel but it keeps throwing me the error Cannot find module '@next/env' as shown here.

enter image description here

I think it's because of the next-sitemap package. I have checked my node modules and there is no env file or folder inside the @next folder. I have also researched around but haven't been able to find any solution.

I have also tried deploying my app on Netlify and it throws the same error. Any help would be appreciated a lot.

UPDATE: I was finally able to solve this by updating my next.js to 10.2.3

1 Answers

just add "@next/env": "^12.0.7" inside dependencies in your package file or just write npm install @next/env

Related