Turborepo "no \"packageManager\" field" - Fix in CI
Turborepo needs to know which package manager runs your workspace. When the root package.json has no packageManager field and the lockfile is ambiguous, turbo errors rather than guess.
What this error means
turbo fails at startup complaining the root package.json has no packageManager field, or that it cannot determine the package manager. It appears on fresh checkouts where corepack/turbo cannot infer the tool.
× We did not find a "packageManager" field in package.json.
╰─▶ Set it to your manager and version, e.g. "pnpm@9.6.0",
so Turborepo can resolve workspaces.Common causes
Missing packageManager field
Newer turbo (and corepack) expect an explicit packageManager value in the root package.json to select the tool and version.
Ambiguous or missing lockfile
Without a single recognizable lockfile, turbo cannot infer the manager from the filesystem alone, so the missing field becomes a hard error.
How to fix it
Add the packageManager field
Pin the exact manager and version at the repo root.
{
"name": "my-monorepo",
"packageManager": "pnpm@9.6.0"
}Enable corepack in CI
corepack reads the field and provisions the right manager version.
corepack enable
turbo run buildHow to prevent it
- Always set
packageManagerin the root package.json of a turbo repo. - Commit a single lockfile for the chosen manager.
- Enable corepack so the pinned manager version is used in CI.