Next.js deployment failure with "No Next.js version detected" error

Problem

I am getting an error during deployment on Vercel. My project uses Next.js and TypeScript. While importing the project, I chose Next.js as the framework.

Error:

No Next.js version detected. Make sure your package.json has “next” in either “dependencies” or “devDependencies”. Also check your Root Directory setting matches the directory of your package.json file.

What I’ve Tried

  1. Uninstalling node_modules and deleting package.json
  2. Reinstalling all dependencies

My project is basically a job search website.

It sounds like there is no Next.js version in your package.json file.

Can you check for this?

"next": "15.0.2"

How did you do this? :slight_smile:

Hi,

That error usually means Vercel cannot find the package.json that contains next, or the project root is set incorrectly.

A few things to check:

  1. In your repo, confirm next is listed in dependencies or devDependencies in the same package.json Vercel is building from.

  2. In Vercel, open Project Settings → General → Root Directory and make sure it points to the folder that contains that package.json.

  3. If this is a monorepo, set the root directory to the actual app folder, for example apps/web.

  4. Make sure the repo includes the lockfile from the same package manager you are using.

  5. Redeploy after changing the root directory or dependencies.

If next is already installed but Vercel still cannot detect it, the most likely cause is that Vercel is building from the wrong directory.