Next.js Discord

Discord Forum

Cannot start Next.js project on Windows:

Unanswered
Band-tailed Pigeon posted this in #help-forum
Open in Discord
Band-tailed PigeonOP
My problem running a new Next.js project on Windows:

I used npx create-next-app to create a brand new Next.js project. I did not change any code at all, but when I run npm run dev, it either gives a “JavaScript heap out of memory” error, gets stuck, or won't start.
If I run the exact same project on macOS, it works perfectly with no errors.
My computer has plenty of free memory and the system is not busy.
I have tried using PowerShell (not MSYS/bash), running as administrator, and setting NODE_OPTIONS="--max-old-space-size=4096". None of these helped.
I tried deleting node_modules, .next, and package-lock.json, then did a fresh npm install, and it still doesn't work.
Strangely, if I use the official Next.js dashboard example (npx create-next-app@latest nextjs-dashboard --example "https://github.com/vercel/next-learn/tree/main/dashboard/starter-example" --use-pnpm), it works and starts up immediately. The issue only happens with the blank vanilla project.
This is my current situation. Has anyone experienced this or know of any solutions?

2 Replies

Can you try running on wsl, its a quick workaround
@Band-tailed Pigeon
I can help you. My DM open for you.