Turborepo "could not resolve workspace" in CI
Turborepo needs to know which package manager and workspace layout you use to build its package graph. Without a packageManager field or valid workspaces globs, it cannot resolve the workspace and stops.
What this error means
turbo fails with "could not resolve workspace" or "Could not resolve workspaces" before any task runs.
Turborepo
x could not resolve workspace
ensure "packageManager" is set in package.json and workspaces are definedCommon causes
The packageManager field is missing
turbo reads the root package.json packageManager field to pick pnpm/npm/yarn. Without it, it cannot resolve the workspace layout reliably.
Workspace globs do not match any packages
The workspaces globs (or pnpm-workspace.yaml) point at paths with no packages, so no members are found.
How to fix it
Set the packageManager field
- Add a
packageManagerfield to the rootpackage.json. - Ensure
workspacesglobs (orpnpm-workspace.yaml) match real package folders. - Re-run turbo so it can resolve the graph.
package.json
{
"packageManager": "pnpm@9.1.0",
"workspaces": ["apps/*", "packages/*"]
}Verify pnpm workspace config
For pnpm, the members live in pnpm-workspace.yaml; make sure its packages globs match the repo layout.
pnpm-workspace.yaml
packages:
- "apps/*"
- "packages/*"How to prevent it
- Always set
packageManagerin the rootpackage.json. - Keep workspace globs aligned with actual package folders.
- Commit the correct workspace config for your package manager.
Related guides
Turborepo "could not find turbo.json" in CIFix Turborepo "could not find turbo.json" in CI - turbo runs outside the repo root or the config file is miss…
Turborepo "failed to read package.json" in CIFix Turborepo "failed to read package.json" in CI - turbo could not parse a package manifest, usually invalid…
Turborepo "No tasks were executed" in CIFix Turborepo "No tasks were executed as part of this run" in CI - the task name or filter matched no package…