Skip to content
Latchkey

yarn/pnpm "Couldn't find package on the workspace registry" in CI

A package declared a workspace: dependency that does not resolve to any local package. The name does not match a sibling, or the version range excludes the sibling’s actual version, so the workspace "registry" has nothing to satisfy it.

What this error means

Install fails with yarn’s "Couldn’t find package <name> on the 'workspace' registry" (or pnpm’s "no matching version found for <name> in workspace"). The dependency points at a workspace package that is missing, misnamed, or version-mismatched.

yarn output
➤ YN0000: ┌ Resolution step
➤ YN0001: │ Error: @acme/ui@workspace:^2.0.0: Couldn't find package "@acme/ui"
required by "@acme/web" on the "workspace" registry

Diagnose it: which packages does the tool think exist?

Workspace failures are usually a globbing or topology problem: the tool cannot see a package, or it resolved a different dependency graph than you expect.

Terminal
# what the package manager sees
npm query ".workspace" 2>/dev/null || pnpm -r list --depth -1 || yarn workspaces list

# what the task runner will actually build, and in what order
npx turbo run build --dry-run=json | head -40
npx nx graph --file=graph.json

Common causes

Dependency name does not match a workspace package

The depended-on name (e.g. @acme/ui) does not exactly match any local package’s name field, so workspace resolution finds nothing.

Version range excludes the local version

A workspace:^2.0.0 range cannot resolve a sibling that is at 1.x. The package exists but its version is outside the requested range.

Package outside the workspace globs

If the sibling lives in a directory not covered by the workspaces globs, it is not part of the workspace registry and cannot satisfy the dep.

How to fix it

Align the name and version range

Match the dependency to the sibling’s exact name, and use a range its version satisfies (workspace:* follows whatever the local version is).

package.json
// apps/web/package.json
{
  "dependencies": {
    "@acme/ui": "workspace:*"
  }
}

Confirm the package is in the workspace

  1. Check the sibling’s name field matches the dependency exactly.
  2. Ensure its directory is covered by the root workspaces / pnpm-workspace.yaml globs.
  3. List workspaces (yarn workspaces list / pnpm -r list --depth -1) to confirm discovery.

How to prevent it

  • Prefer workspace:* for intra-repo deps to avoid range mismatches.
  • Keep workspace globs covering every package directory.
  • Keep sibling package name fields stable and referenced exactly.

Frequently asked questions

What causes yarn/pnpm "Couldn't find package on the workspace registry" in CI?
There are 3 common causes: dependency name does not match a workspace package, version range excludes the local version, and package outside the workspace globs. The depended-on name (e.g.
How do I fix yarn/pnpm "Couldn't find package on the workspace registry" in CI?
There are 2 fixes depending on which cause you have: align the name and version range and confirm the package is in the workspace. Work through them in order, since the first is the most common.
What does yarn/pnpm "Couldn't find package on the workspace registry" in CI actually mean?
Install fails with yarn’s "Couldn’t find package <name> on the 'workspace' registry" (or pnpm’s "no matching version found for <name> in workspace").
How do I stop yarn/pnpm "Couldn't find package on the workspace registry" in CI happening again?
Prefer workspace:* for intra-repo deps to avoid range mismatches. The prevention section lists 3 changes that keep it from recurring.

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