Skip to content
Latchkey

Nx "The project does not exist" in CI

Nx could not find a project by the name you passed. It was renamed, its project.json is missing, or its directory is outside the configured workspace globs.

What this error means

An nx run <project>:<target> or --projects=<name> command fails with "The <name> project does not exist in this workspace". Nx lists known projects but yours is absent.

nx
NX   The "payments" project does not exist in this workspace.

Diagnose it: task graph and workspace resolution

Terminal
npx turbo run build --dry-run=json | head -40
npx nx graph --file=graph.json
pnpm -r list --depth -1 2>/dev/null || yarn workspaces list

Common causes

Project renamed or not registered

The name in project.json differs from what you invoke, or a rename did not update callers.

Missing project.json

A project without a discoverable project.json (or recognized package.json) is never added to the graph.

Outside the workspace layout

A project in a directory not covered by workspace globs is never discovered.

How to fix it

List the projects Nx knows

  1. Confirm the canonical project name in the graph.
Terminal
nx show projects

Fix the name or add config

  1. Match the invoked name to the project.json name field.
  2. Add a project.json if one is missing.
  3. Ensure the directory is within configured project locations.

How to prevent it

  • Keep project names stable and grep for old names after a rename so CI scripts stay in sync.

Frequently asked questions

What causes Nx "The project does not exist" in CI?
There are 3 common causes: project renamed or not registered, missing project.json, and outside the workspace layout. The name in project.json differs from what you invoke, or a rename did not update callers.
How do I fix Nx "The project does not exist" in CI?
There are 2 fixes depending on which cause you have: list the projects nx knows and fix the name or add config. Work through them in order, since the first is the most common.
What does Nx "The project does not exist" in CI actually mean?
An nx run <project>:<target> or --projects=<name> command fails with "The <name> project does not exist in this workspace".
How do I stop Nx "The project does not exist" in CI happening again?
Keep project names stable and grep for old names after a rename so CI scripts stay in sync.

Related guides

References

Not every red build is your code. Latchkey repairs the ones that are not, on the runner. Start free → 30-day trial · No credit card