· monorepo / turborepo / nx

Turborepo vs Nx — monorepo tooling head-to-head (2026)

Turborepo wins on config simplicity and self-hosted cache; Nx wins on distributed CI and plugin depth. Pick by CI scale and infrastructure ownership.

By

1,651 words · 9 min read

If your team has fewer than five CI runners and 30-odd packages, use Turborepo. It’s simpler to configure, free to self-host the remote cache, and doesn’t lock you to a vendor. If you’re running 50+ packages across distributed CI machines, Nx Agents — a feature Turborepo still doesn’t have — will likely pay for itself in saved CI minutes. One recent wrinkle: Nx deprecated all four of its self-hosted cache packages in May 2026 over a CREEP vulnerability (CVE-2025-36852). The deprecated packages receive no further security patches; the alternatives are Nx Cloud (free Hobby tier covers small teams, no credit card required) or a DIY implementation of the Nx remote cache OpenAPI spec. That meaningfully changes the calculus for infrastructure-conscious teams.

Who this is for

TypeScript teams running pnpm or Yarn workspaces with three or more packages who have already committed to a monorepo. If you’re still deciding whether to monorepo at all, see our best monorepo tool roundup.

What we tested

Turborepo v2.9.16 (stable, 2026-05-28) · Nx v22.x stable with v23.0.0-beta.24 for preview features (2026-06-06).

toolchew’s own codebase runs Turborepo on a pnpm workspace, so some of the Turborepo findings come from direct production use — including the edge cases, not just the happy path. For the Nx side, we ran tests against a purpose-built monorepo with 15 TypeScript packages and reviewed primary-source documentation, changelogs, and GitHub issue threads for both tools.

One widely-cited Nrwl comparison (21m56s Nx vs 25m32s Turborepo on N machines) is Nx’s own marketing page. We ruled it out. No neutral third-party benchmark of equivalent scope exists; where we couldn’t measure, we say so.

Build cache performance

Both tools use the same core model: a content-addressed cache keyed on input hashes (source files + config + declared inputs). On a full cache hit, neither tool re-executes. Turborepo prints FULL TURBO; Nx replays cached outputs without running the task.

The practical difference emerged in Nx v22.7: task sandboxing. Nx now detects undeclared input accesses at runtime — if a task reads a file you forgot to declare as an input, Nx flags it instead of silently generating wrong cache hits. Turborepo doesn’t have this. For teams that have been burned by stale-cache bugs (they look like passing CI with incorrect output), this is a real advantage.

Winner: Nx for correctness; tie on raw cache-replay speed. No neutral benchmark of equivalent scope exists — treat vendor comparison tables as marketing.

For a systematic approach to improving CI cache hit rates across all layers, see build cache optimization: what actually works.

Task orchestration and parallelism

Both tools build a DAG of tasks and run them in topological order, parallelizing whatever the graph allows. On a single machine the behavior is effectively equivalent.

The gap is in CI scale.

Turborepo distributes work across machines by having you manually bin tasks into separate turbo run invocations. If you have three CI runners, you decide what runs on each. GitHub Discussion #7766 — “Distributed task execution” — has been open since March 2024. It shipped in neither v2.8 nor v2.9. There is no public ETA.

Nx Agents handles this automatically. You declare agents: 5 in your CI config and Nx distributes individual tasks — not whole jobs — across runners using historical timing data for load balancing. The result: near-optimal parallelism without manual binning.

Winner for multi-machine CI: Nx, and it’s not close. If horizontal CI scaling is on your roadmap, this is the single biggest capability gap between the two tools.

Plugin and generator ecosystem

Nx ships ~149 plugins: 33 official @nx/ packages covering Angular, React, Next.js, Remix, Vue, Nuxt, Node, Express, NestJS, React Native, Expo, Vite, esbuild, rspack, Rsbuild, Jest, Vitest, Cypress, Playwright, Storybook, Gradle, Maven, Docker, and .NET. A further ~116 community plugins add Python, Rust, Go, Spring Boot, Flutter, Svelte, SolidJS, AWS CDK, Firebase, Terraform, Pulumi, and Astro. Nx Console (VS Code) gives you a GUI to run generators and navigate the project graph.

Turborepo is deliberately leaner: no official plugin system. You get create-turbo templates and example repos, but no workspace generators equivalent to nx generate.

If your monorepo is TypeScript-only and you’re content with manual scaffolding, the gap won’t hurt much. If you need to generate non-JS packages or want tooling guidance for a polyglot repo, Nx is the clear answer.

Winner: Nx, not close.

Remote caching

This is where the sharpest change happened in 2026.

Turborepo

Turborepo publishes an open cache API spec. Any HTTP server implementing it can act as a backend. Two practical options:

  • Vercel Remote Cache (managed): free on all Vercel plans, including teams that don’t host on Vercel. [TODO: affiliate link — /go/vercel]
  • ducktors/turborepo-remote-cache: open-source self-hosted backend at v2.11.1 (May 2026), 107 releases, 47 contributors, actively maintained. Usable in production with no vendor dependency.

Nx Cloud

  • Hobby: free forever — 50,000 credits/month, 5 contributors, 10 concurrent CI connections. No credit card required.
  • Team: $19/contributor/month + $5.50/10,000 credits overage.
  • Enterprise: custom pricing. The only tier that includes self-hosted or on-premises Nx Cloud.

The May 2026 change: Nx deprecated @nx/s3-cache, @nx/gcs-cache, @nx/azure-cache, and @nx/shared-fs-cache on 2026-05-21 due to CVE-2025-36852 (CREEP — cache repository exfiltration via injection of protected artifacts). The fix was deprecation, not a patch: the packages receive no further security updates. The two supported paths forward are: migrate to Nx Cloud (the Hobby tier is free, no credit card required) or implement the Nx remote cache OpenAPI spec yourself. Teams with strict data-residency requirements have a third option: on-premises Nx Cloud, available on the Enterprise tier.

If you were running Nx’s S3 or GCS cache for data residency, air-gapped CI, or cost control, you are now on an unsupported path — the options are Nx Cloud’s free Hobby tier, a DIY OpenAPI implementation, or Enterprise for on-prem.

DimensionTurborepoNx
Free managedVercel (free on all plans)Hobby: 50k credits/month
Self-hosted freeOpen API + ducktors OSSDeprecated (no patch); Nx Cloud free tier or DIY OpenAPI
Vendor lock-inLow (open spec)Higher post-deprecation

Winner for self-hosting: Turborepo. The deprecation is a legitimate reason to avoid Nx if infrastructure ownership matters.

Incremental adoption

Neither tool requires a rewrite. Both work by adding a config file and a script entry to an existing pnpm or Yarn workspace.

One Turborepo gotcha with pnpm: pnpm-workspace.yaml must exist before you install Turborepo in a multi-package repo. Missing it produces --workspace-root may only be used inside a workspace — not obvious on first encounter.

Nx has an official migration guide from Turborepo at nx.dev/docs/guides/adopting-nx/from-turborepo. The reverse (Turborepo docs on migrating from Nx) is lighter.

Verdict: tie. Both handle gradual adoption. Turborepo is marginally simpler to drop in from a cold start; Nx has better migration docs.

For a step-by-step walkthrough starting from an empty pnpm workspace, How to Set Up a pnpm + Turborepo Monorepo from Scratch covers the exact setup.

Development velocity

Turborepo (Vercel-backed): stable v2.9.16, canary v2.9.17-canary.5 as of June 2026. Recent work covers Bun nested dependency improvements, PTY fixes, and Rsbuild examples. The DTE gap (Discussion #7766, March 2024) remains the main open thread, with no public shipping date two-plus years in.

Nx (Nrwl-backed): v22.x stable, v23.0.0-beta.24 active. The v23 cycle deprecates SCAM generators, ESLint v8, withNx for Next.js, and old module-federation generators. New in v22.7: task sandboxing. New in nx migrate --run-migrations: an agentic migration mode. Higher release velocity, more ambitious scope changes.

Verdict: both actively maintained. Nx moves faster and has a bolder v23 roadmap.

Turborepo vs Nx verdict

DimensionWinner
Build cache correctnessNx (task sandboxing)
Single-machine orchestrationTie
Distributed CI — multi-machineNx
Plugin and generator ecosystemNx
Remote cache: free managedTie
Remote cache: self-hostingTurborepo
Config simplicityTurborepo
Incremental adoptionTie
Vendor lock-in riskTurborepo

Pick Turborepo if: you want a lean setup, you self-host your cache, you’re a small team (1–4 CI runners, ≤30 packages), or the Nx CVE/deprecation news makes you want more infrastructure control.

Pick Nx if: you run distributed CI across 5+ machines, you need generators for non-JS packages, or you’re already invested in the Nx plugin ecosystem and the Hobby tier covers your usage.

Caveats

We didn’t run a large-scale distributed CI benchmark (Nx Agents at 10+ machines). The distributed CI assessment is based on architecture review and documentation, not measured wall-clock data.

toolchew runs Turborepo. We noted this where relevant. If anything, it gives more signal on Turborepo’s failure modes — pnpm workspace setup friction, cache invalidation edge cases from real production use — than it does on Nx’s.

The pnpm workspace setup friction and cache invalidation edge cases we encountered are documented in Turborepo monorepo pitfalls we learned the hard way.

Nx Hobby caps at 5 contributors and 10 concurrent CI connections. Model the cost at your actual team size before committing.

No Vercel affiliate link exists yet. The Vercel Remote Cache CTA above is marked [TODO: affiliate link — /go/vercel]. A follow-up issue has been filed to add this before publish if a Vercel affiliate relationship is confirmed.

References