Turborepo
Turborepo is a high-performance build system designed for JavaScript and TypeScript monorepos. It optimizes builds and tests using caching and parallel execution. The current stable version is 2.9.6, with frequent canary releases pushing fixes and new features.
Common errors
-
Error: Failed to authenticate with Vercel for remote caching.
cause Vercel authentication token is expired, invalid, or permissions are insufficient, or the authentication flow has changed.fixRun `npx turbo login` to re-authenticate or verify `TURBO_TOKEN` in CI/CD. Refer to documentation for the latest authentication procedures (especially for versions >=2.9.7). -
Error: Failed to parse pnpm-lock.yaml: unknown format version
cause Using pnpm v11 multi-document lockfiles with Turborepo versions prior to 2.9.7.fixUpgrade Turborepo to v2.9.7 or newer to ensure full compatibility with pnpm v11 lockfiles. -
Error: Task 'build' did not exit cleanly
cause Turborepo process or its child processes did not terminate gracefully, potentially leading to hanging processes or incorrect exit codes in CI/CD environments.fixUpgrade Turborepo to v2.9.7 or newer to benefit from improved graceful shutdown handling.
Warnings
- breaking Turborepo v2.9.7 introduces a transition to standard OAuth/device flows for Vercel authentication. This is a breaking change for existing setups relying on legacy token methods for remote caching, including CI/CD.
- gotcha Even with recent fixes, users might encounter transient issues with Vercel authentication token persistence across login flows or after updates. This can lead to unexpected remote cache misses.
Install
-
npm install turbo -
yarn add turbo -
pnpm add turbo
Quickstart
npx create-turbo@latest my-monorepo cd my-monorepo pnpm install npx turbo dev