Skip to content
Latchkey

Nx "Cannot find project" in CI

Nx resolves targets through its project graph. The name you ran is not in that graph because the project config is missing, renamed, or the cached graph is stale.

What this error means

nx run web:build fails with "Cannot find project 'web'". The project exists on disk but Nx does not see it, often after a rename or a partial checkout.

node
Cannot find project 'web'. Please check the spelling and make sure the
project's project.json or package.json has the correct name.

Common causes

Project name mismatch

The name in project.json or package.json differs from the name passed to nx, or the project folder is not under a configured workspace path.

Stale Nx graph cache

A cached project graph in .nx/cache predates a rename or new project, so Nx resolves against outdated data.

How to fix it

Reset the Nx cache and graph

Clear the daemon and cache so Nx rebuilds the project graph from current files.

Terminal
npx nx reset
npx nx show projects

Verify the project name and location

Confirm the name in project.json matches the target you run and the folder is inside a workspace glob.

  1. Run nx show projects to list what Nx actually sees.
  2. Check the name field in the project config.
  3. Ensure the directory matches workspaceLayout/appsDir patterns.

How to prevent it

  • Run nx show projects to confirm names match before invoking targets.
  • Run nx reset in CI when the graph may be stale after renames.
  • Keep project.json names in sync with directory and script references.

Related guides

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