I’ve just been going through the article " How to Integrate MongoDB Into Your Next.js App". Everything worked OK when I used ‘npm run dev’. But when I got near the end where it says to use ‘npm run build’, it gave this error:
Then I deleted the mflix directory and ran only these commands:
npx create-next-app --example with-mongodb mflix
cd mflix
npm run build
But the same thing happened again.
I’m using Node v17.0.0 on Windows 10.