How to fix the error: "No Next.js version could be detected in your project." when deploying to Vercel with Turborepo and pnpm

Viewed 1443

I am trying to deploy the Turborepo example app to Vercel using instructions from here, and getting the error:

Error: No Next.js version could be detected in your project. Make sure `"next"` is installed in "dependencies" or "devDependencies"

How can I fix it?

1 Answers

Docs says that the build command npm install --prefix=../.. is only required if using npm workspaces, and doesn't apply when using pnpm or yarn workspaces. Since am using pnpm, I replace npm install --prefix=../.. with pnpm i -r and it worked.

Related