In a monorepo, Vercel’s Root Directory tells it which app to build. When it points at the repo root (or the wrong package), Vercel installs/builds the wrong thing - and the build fails or deploys the wrong output.
What this error means
A monorepo deploy installs the root workspace, runs the wrong build, or reports a missing build/output because Vercel is rooted at the repo top rather than the app directory. It is deterministic until the Root Directory setting is corrected.
Vercel build log
Error: No Next.js version detected. Make sure your package.json has "next"
in either "dependencies" or "devDependencies".
# (building from repo root instead of apps/web)
Diagnose it: credentials and state before configuration
Infrastructure jobs fail on access far more often than on configuration. Confirm the runner can authenticate and reach remote state before reading the plan.
Terminal
# who am I on this runner?
<cloud-cli> auth list 2>/dev/null || <cloud-cli> sts get-caller-identity
# can the backend be reached and locked?
terraform init -backend=true -input=false
Common causes
Root Directory points at the wrong package
The project’s Root Directory is the repo root (or another package), so Vercel reads the wrong package.json and cannot detect the framework or find the app’s build.
Workspace install not configured
Without telling Vercel to install from the workspace root, hoisted dependencies may be missing when building a single package.
How to fix it
Set the Root Directory to the app
In Project Settings → General, set Root Directory to the app folder (e.g. apps/web).
Enable "Include files outside the Root Directory" if the build needs shared workspace packages.
Set the framework preset on that project so detection matches the app.
Pin install/build for the workspace
Use a build/install command that resolves the workspace correctly from the app root.
vercel.json
{
"installCommand": "npm ci",
"buildCommand": "turbo run build --filter=web"
}
How to prevent it
Set Root Directory per Vercel project to the specific app in the monorepo.
Use a monorepo-aware build (turbo/nx) with an explicit filter.
Enable including files outside the root when shared packages are needed.
Frequently asked questions
What causes Vercel monorepo "Root Directory" mismatch?
There are 2 common causes: root directory points at the wrong package and workspace install not configured. The project’s Root Directory is the repo root (or another package), so Vercel reads the wrong package.json and cannot detect the framework or find the app’s build.
How do I fix Vercel monorepo "Root Directory" mismatch?
There are 2 fixes depending on which cause you have: set the root directory to the app and pin install/build for the workspace. Work through them in order, since the first is the most common.
What does Vercel monorepo "Root Directory" mismatch actually mean?
A monorepo deploy installs the root workspace, runs the wrong build, or reports a missing build/output because Vercel is rooted at the repo top rather than the app directory.
How do I stop Vercel monorepo "Root Directory" mismatch happening again?
Set Root Directory per Vercel project to the specific app in the monorepo. The prevention section lists 3 changes that keep it from recurring.