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.
➤ YN0000: ┌ Resolution step
➤ YN0001: │ Error: @acme/ui@workspace:^2.0.0: Couldn't find package "@acme/ui"
required by "@acme/web" on the "workspace" registryCommon 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).
// apps/web/package.json
{
"dependencies": {
"@acme/ui": "workspace:*"
}
}Confirm the package is in the workspace
- Check the sibling’s
namefield matches the dependency exactly. - Ensure its directory is covered by the root
workspaces/pnpm-workspace.yamlglobs. - 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
namefields stable and referenced exactly.