Skip to content
Latchkey

Turborepo "Could not find turbo.json" in CI

turbo walks up from the current directory looking for turbo.json and the workspace root. In CI it failed because the cwd was wrong or the config was not checked out.

What this error means

turbo exits immediately with "Could not find turbo.json or turbo.jsonc". It works locally from the repo root but fails in the job that runs from a subdirectory.

node
  x Could not find turbo.json or turbo.jsonc in the current
  | working directory or any parent directory.

Common causes

Wrong working directory

The job ran turbo from a package folder above which there is no turbo.json, so the upward search failed.

turbo.json not committed

The config is untracked or gitignored, so the clean CI checkout has nothing to find.

How to fix it

Run turbo from the workspace root

Set the job working directory to the monorepo root where turbo.json lives.

workflow
# in the workflow step
# working-directory: .   (repo root)
turbo run build

Commit turbo.json

Track the config so CI checks it out.

  1. Confirm turbo.json is not listed as untracked in git status.
  2. Remove any .gitignore entry hiding it.
  3. Commit and re-run.

How to prevent it

  • Keep turbo.json at the monorepo root and tracked in git.
  • Run turbo from the repo root in CI.
  • Verify a clean checkout contains turbo.json before merging.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →