Turborepo vs Nx (2026): Which Monorepo Tool to Ship With
Turborepo vs Nx for JavaScript monorepos: task runners, remote caching, affected CI, Lerna, and when a thin Turbo layer or a full Nx platform fits your team.

Turborepo vs nx is the question teams ask once a pnpm or npm workspace outgrows pnpm -r run build. You already have packages. You need ordered tasks, cache hits, and CI that skips unchanged apps. Turborepo is a task runner and cache on top of the package manager you already use. Nx is a build system and platform: project graph, plugins, generators, module boundaries, and Nx Cloud for remote cache and CI features.
This page is a developer-to-developer comparison from a team that ships TurboStarter as a pnpm workspace with Turborepo 2.11.10 (see root package.json and turbo.json). We do not claim benchmark wins here. Official docs are the source for product behavior and pricing shapes, read on 3 December 2026.
For depth on one side of the fence, see Turborepo best practices, the Turborepo monorepo guide, and getting started with the Turborepo CLI. Nx maintains its own migration from Turborepo.
Turborepo vs Nx: the short answer
Pick Turborepo when you want a thin scheduler and content hash cache on top of pnpm workspaces (or npm, Yarn, Bun), a single root turbo.json, and scripts that stay in each package's package.json. It fits most TypeScript SaaS monorepos that only need run, cache, filter, and remote cache.
Pick Nx when you need a first-class project graph across stacks, inferred tasks from Vite or Gradle configs, generators, module boundary rules, Ultracache on Nx Cloud, distributed CI workers, or polyglot repos where JS and non-JS projects share one graph.
Pick neither alone for installs: you still want a workspace tool (pnpm monorepo layout, npm workspaces, and similar). Turborepo and Nx orchestrate tasks; they do not replace the lockfile.
Turborepo vs Nx at a glance
| Factor | Turborepo | Nx |
|---|---|---|
| What it is | High-performance task runner and cache for JS/TS monorepos (docs intro) | Monorepo build system, plugins, graph, and CI platform (nx.dev) |
| Primary config | Root turbo.json (tasks, optional per-package turbo.json) | Root nx.json plus per-project project.json or inferred config |
| Task source | package.json scripts you already wrote | Same scripts or targets inferred by Nx plugins |
| Local caching | Content-aware hashing, .turbo directory | Local cache before remote (remote cache docs) |
| Remote caching | Vercel Remote Cache (free on all plans, including off Vercel); self-hosted servers implementing the Remote Cache API (remote caching) | Nx Cloud via nx connect; hobby tier for external CI; usage-based CI Plan in beta (pricing, checked 3 Dec 2026) |
| Affected / filtering | turbo run build --affected, --filter, ...[base...HEAD] syntax (turbo run reference) | nx affected -t build, project matchers (-p admin-*, tags) (from-turborepo guide) |
| Code generation | turbo gen / @turbo/gen (Plop-style workspace generators) | nx generate, first-party and community plugins |
| Plugins / inference | Wraps existing scripts; framework env inference for cache hashes | First-party plugins (Vite, Jest, ESLint, and others), inferred inputs/outputs |
| Language support | JS/TS ecosystems via package manager workspaces | JS/TS plus Java (.NET, Maven, Gradle) and community plugins (Python, Rust, Go) per Nx marketing and migration docs |
| Visualization | Dependency insights via CLI and docs | nx graph, Nx Console |
| Boundaries | turbo boundaries (tags on packages) | ESLint module boundary rules, conformance (enterprise) |
| Learning curve | Smaller surface: one JSON file, npm scripts | Larger surface: graph, executors, Nx Cloud concepts |
| Ownership / lock-in | Open source runner; remote cache portable to self-hosted API | Open source core; advanced CI and Ultracache tied to Nx Cloud tiers |
| Typical pairing | pnpm + Turborepo (this repo) | pnpm, npm, or Yarn + Nx |
What is Turborepo?
Turborepo is maintained by Vercel. It runs the scripts defined in workspace package.json files, builds a task graph from dependsOn, hashes inputs (files, env vars, lockfile), and restores outputs from a local or remote cache. It does not install dependencies. Your package manager does.
Adoption is incremental: add turbo.json, wire root scripts ("build": "turbo build"), declare packageManager in the root package.json (required in Turborepo 2.x). Turborepo 2.0 renamed pipeline to tasks and made strict environment mode the default.
What is turborepo in one sentence for search: it is the turbo CLI plus remote cache that keeps monorepo CI from rebuilding unchanged packages.
What is Nx?
Nx is an open source monorepo toolkit originally aimed at Angular, now used across JS and other stacks. It understands a project graph (apps and libraries), can infer tasks from tool configs, provides generators to scaffold projects, and integrates with Nx Cloud for shared cache, analytics, distributed workers, and (on supported versions) Ultracache that records files tasks actually read.
nx init on an existing Turborepo repo converts turbo.json to nx.json so both can run side by side until you remove Turborepo (migration guide).
Task running and caching
Both tools cache task outputs when inputs match. Both need explicit outputs (build folders, and similar) or restorers replay logs without artifacts.
Turborepo: turbo.json and real TurboStarter tasks
TurboStarter's root config (abbreviated) shows patterns production repos use:
{
"$schema": "https://turbo.build/schema.json",
"ui": "tui",
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": [
".cache/tsbuildinfo.json",
"dist/**",
".output/**",
".vercel/output/**",
".tanstack/**"
]
},
"dev": {
"cache": false,
"persistent": false
},
"typecheck": {
"dependsOn": ["^build"],
"outputs": [".cache/tsbuildinfo.json"]
},
"setup": {
"cache": false,
"dependsOn": ["@workspace/db#db:setup"]
}
},
"globalEnv": ["DATABASE_URL", "DEMO_DATABASE_URL", "VERCEL"],
"globalPassThroughEnv": ["NODE_ENV", "CI", "npm_lifecycle_event"]
}^build means "build dependency packages first." A bare build in the same package would only order tasks inside that package. globalEnv participates in every task hash. See Turborepo best practices for outputs, strict envMode, and passThroughEnv.
Nx: nx.json and targetDefaults
After nx init, Turborepo's tasks.build block becomes targetDefaults.build with {projectRoot} path tokens (mapping table). Package-specific overrides like web#build become filtered entries in an array under the same task name.
Nx can also define targets in project.json or infer them from vite.config.ts so you do not duplicate outputs by hand. That reduces cache misconfiguration at the cost of learning Nx's plugin model.
Caching philosophy
- Turborepo remote caching hashes what you declare in
inputs,env, andglobalEnv. Wrong declarations produce wrong hits; the docs warn to fix local caching before sharing artifacts (remote caching). - Nx adds Ultracache on Nx Cloud Workers to record files a task actually read, which Nx documents as improving hit rates when manual
inputsare incomplete (Ultracache section). That feature is Nx Cloud specific, not something Turborepo ships as of these docs.
Remote caching
Turborepo remote caching
Local .turbo/cache helps one machine. Turborepo remote caching shares artifacts across laptops and CI.
- Vercel Remote Cache: free on all Vercel plans, even if you do not deploy on Vercel (remote caching). Link with
turbo loginandturbo link, or setTURBO_TOKENandTURBO_TEAMin CI. - Self-hosted: any server implementing the Turborepo Remote Cache HTTP API;
turbo login --manualfor custom endpoints. Community implementations are listed in the same doc.
Optional remoteCache.signature plus TURBO_REMOTE_CACHE_SIGNATURE_KEY verifies artifact integrity on download.
Nx Cloud remote cache
Connect with npx nx connect or nx login. Cached entries include terminal output and declared outputs; source files are hashed, not stored (remote cache). Nx documents read/write token scoping for CI branches to reduce cache poisoning risk.
Pricing (checked 3 December 2026): nx.dev/pricing lists a Hobby tier for external CI, a CI Plan in beta (usage-based worker minutes, $0 base fee during beta at time of writing), and Enterprise options. Credits and concurrent workers apply on paid tiers. Treat numbers as current on that page, not guarantees here.
Turborepo's remote cache has no per-minute credit model on Vercel's free remote cache offering. Nx's bill grows with Nx Cloud CI features you enable. Compare total cost (runner minutes plus cache service), not CLI speed claims.
Affected builds in CI
Both tools need enough Git history to compare against a base branch.
Turborepo in GitHub Actions
From Turborepo's CI guide and run reference:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
filter: blob:none
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
- uses: vercel/setup-turborepo-remote-cache-action@v1.0.0
- run: pnpm turbo run build lint test --affected--affected aligns with --filter=...[main...HEAD]. Set TURBO_SCM_BASE when your default branch is not main. Shallow fetch-depth: 1 breaks affected detection.
Nx in GitHub Actions
From Nx's migration and remote cache docs:
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: npm ci
- run: npx nx affected -t build lint testDistributed execution uses nx-cloud start-workers and related steps (Nx Cloud docs). That path has no Turborepo equivalent.
| Topic | Turborepo | Nx |
|---|---|---|
| Command | turbo run <tasks> --affected | nx affected -t <tasks> |
| Scope | Package-level by default; optional task-level with futureFlags.affectedUsingTaskInputs | Project graph plus Ultracache recordings in CI |
| History | fetch-depth: 0 or blobless clone | fetch-depth: 0 |
Developer experience and migration
Adding Turborepo to an existing pnpm workspace
- Add
turboas a dev dependency andpackageManagerfield. - Create
turbo.jsonwithtasksmirroring scripts (build,lint,test,dev). - Point root scripts at
turbo run <task>. - Fix
outputsand env hashing before enabling remote cache.
The get started with Turborepo CLI walkthrough and pnpm workspace docs cover install and linking. pnpm monorepo vs turborepo is not either/or: pnpm links packages; Turborepo runs and caches tasks.
Adopting Nx (nx init)
npx nx@latest init reads turbo.json, writes nx.json, and leaves Turborepo in place until you delete it (step-by-step migration). Expect to port persistent: true to continuous: true, move per-package turbo.json overrides to filtered targetDefaults, and reattach sharedGlobals when tasks define their own inputs.
Moving between them
- Turborepo to Nx: official
nx initpath, then CI switch tonx affected, then removeturbo. - Nx to Turborepo: no single official codemod. You keep package scripts, recreate
tasksinturbo.json, and replacenx run-manywithturbo run.
Running both temporarily is supported during Nx migration. Long term, one orchestrator keeps mental overhead low.
Turbopack vs Turborepo
Different tools. Easy to confuse because both names start with "Turbo."
Turbopack is a bundler focused on dev and build performance inside frameworks such as Next.js (Turbopack guide). Turborepo never bundles your app. It runs vite build, next build, or whatever script each package defines. TurboStarter's web app uses Vite/TanStack Start; Turborepo schedules build across packages. A fast bundler does not replace a monorepo task graph.
Nx vs Lerna vs Turborepo
Lerna was the early JavaScript monorepo CLI for versioning and publish workflows. Lerna's introduction states Nx took over stewardship. From Lerna v6+, lerna run delegates scheduling and caching to Nx's task runner. Lerna still shines at npm publish flows (lerna version, fixed or independent modes).
| Tool | Best for |
|---|---|
| Turborepo | Task running and caching on npm-style workspaces without adopting the full Nx graph |
| Nx | Graph, plugins, generators, enterprise conformance, Nx Cloud CI |
| Lerna | Release management on top of workspaces; task execution now piggybacks on Nx |
Nx vs lerna vs turborepo and turborepo vs nx vs lerna usually mean: use Lerna only if npm publishing is the hard problem; use Turborepo or Nx for day-to-day builds. You can run Lerna publish in an Nx workspace; you do not need Lerna to use Turborepo.
When to choose Nx
Consider Nx when:
- Multiple languages or build tools must share one dependency graph (Java services beside TypeScript apps, per Nx's migration marketing).
- You want generators and inferred tasks so
outputstrack Vite or Jest configs automatically. - Module boundary rules and conformance dashboards are non-negotiable for a large org.
- You plan to use Nx Cloud Workers, dynamic distribution, or Self-Healing CI as your primary CI product.
- You are already on
@nx/*plugins andnx graphis part of day-to-day debugging.
Nx wins on platform breadth. You pay in config surface area and (if you use advanced CI) Nx Cloud pricing.
When to choose Turborepo
Consider Turborepo when:
- The repo is JavaScript or TypeScript with pnpm (or npm/Yarn) workspaces and standard package scripts.
- You want minimal config: one
turbo.json, remote cache on Vercel for free, and filters for CI. - Team ownership matters: fewer concepts between
pnpm installandturbo run build. - You are standardizing on Vercel deploys or already documented Turborepo in your starter kit.
Turborepo wins on simplicity and fitting the npm ecosystem. It does not replace publish tooling (use Changesets, Lerna, or your own release scripts) or polyglot graph analysis.
How TurboStarter does it
TurboStarter is a production-ready starter kit (not just a task runner) laid out as:
- pnpm workspace:
apps/*,packages/*,tooling/*(pnpm-workspace.yaml) - Turborepo for
dev,build,test,typecheck, and setup tasks - Shared packages (
@workspace/api,@workspace/auth,@workspace/db,@workspace/ui, and others) consumed by deployable apps
This open source snapshot centers on the TanStack Start web app under apps/web, with the full kit documented for web, Expo mobile, and browser extension surfaces in cross-platform SaaS with one backend. Compare the free create-t3-turbo template in create-t3-turbo vs TurboStarter.
Monorepo hygiene we rely on:
- Renovate vs Dependabot for dependency PRs (orthogonal to Turborepo, but keeps cache keys changing predictably).
- Oxc migration for fast lint/format at the repo root (
//#linttasks inturbo.json). - Project structure for where apps and packages live.
- Which TurboStarter kit to choose when you buy the kit, not when you pick Turborepo over Nx.
We chose Turborepo because the product is ship a SaaS, not operate a build-system platform. One backend, multiple clients, strict TypeScript packages: Turborepo stays out of the way. If you outgrow it, Nx's migration path exists.
FAQ
Neither is universally better. Turborepo is a strong default for turborepo monorepo workflows that are mostly TypeScript, script-driven, and pnpm-based. Nx is stronger when you need its graph, plugins, generators, Ultracache, and Nx Cloud CI as a package. This page compares tradeoffs; see Nx vs Turborepo context on nx.dev for Nx's view.
Yes, temporarily. nx init keeps turbo.json until you finish migration (migration guide). Running both long term doubles config and confuses newcomers. Pick one orchestrator for CI.
The turbo CLI is open source. Vercel Remote Cache is free on all Vercel plans, including repos that deploy elsewhere (remote caching). Self-hosted cache servers are your infrastructure cost. You still pay for CI runners and Vercel/hosting separately.
Yes. Nx supports pnpm workspaces the same way it supports npm and Yarn. nx init does not remove your package manager. You still declare workspaces in pnpm-workspace.yaml (pnpm workspaces).
No, but its role changed. Nx stewards Lerna; lerna run uses Nx's task runner in v6+ (Lerna introduction). Many teams use Lerna for publishing and Turborepo or Nx for builds.
Marketing pages on both sides cite large-repo benchmarks (Nx's site references multi-machine CI comparisons). Those numbers depend on repo shape, cache correctness, and hardware. For your repo, measure turbo run build vs nx run-many -t build with a warm cache and fair outputs/inputs. This post does not quote speed figures.
You can run pnpm -r run build without Turborepo or Nx. You lose cross-package task ordering (^build), content caching, remote cache, and affected CI shortcuts. Many teams add turborepo monorepo tooling once CI time or fan-out grows past a few packages.
Sources (checked 3 December 2026)
- Turborepo documentation (overview, tasks, remote caching,
turbo run, CI) - Nx documentation (adopting Nx from Turborepo, remote cache, Ultracache)
- Nx pricing (Hobby, CI Plan beta, Enterprise)
- Lerna documentation (Nx stewardship,
lerna runand Nx) - pnpm workspaces
Turborepo - the ultimate guide to modern JavaScript monorepo management
Master Turborepo for monorepo management with setup tips, Turborepo vs Nx guidance, caching strategies, and best practices for faster JavaScript builds.
Vercel vs Cloudflare: Where to Host Your SaaS in 2026
Vercel vs Cloudflare for a SaaS: Node functions and Next.js on Vercel, or Workers, R2, and TanStack Start on Cloudflare. How to pick in 2026.



