No Next.js version detected

I check my package.json and Root Directory many times,and I ensure they are right.

but I got the error “No Next.js version detected.”

I don’t know what’s the problem, help please!

What happens if you run vercel build on the local repo?

it is worked


and vercel cli version is 47.1.4
node version is 20.19.5

image

Do you see any other error details in the build logs?

If you have a public repo or minimal reproducible example, I could use that to debug this with you.

I delete package-lock.json and node_modules directory and run npm install again to solve this problem!
thank you amy’s help! you’re so helpful

Happy to hear there was a simple solution! Thanks for coming back to share how you fixed it