Skip to content
Latchkey

pnpm "workspace:" protocol not resolving in CI

The workspace: protocol tells pnpm to link a dependency from another package in the same monorepo instead of the registry. If the target package is not covered by pnpm-workspace.yaml, pnpm cannot find it and the install fails.

What this error means

pnpm install fails with "In <project>: "@acme/utils@workspace:*" is in the dependencies but no package named "@acme/utils" is present in the workspace" or a similar "not found in workspace" error.

pnpm
ERR_PNPM_WORKSPACE_PKG_NOT_FOUND  In apps/web: "@acme/utils@workspace:*" is in the dependencies but no package named "@acme/utils" is present in the workspace

Common causes

The package directory is not listed in pnpm-workspace.yaml

pnpm only treats directories matched by the packages: globs as workspace members; a package outside those globs is invisible to workspace:.

The package name does not match the dependency key

The name field in the target package.json differs from what the dependent references, so pnpm cannot map workspace:* to it.

How to fix it

Include the package in the workspace globs

  1. Confirm the target package directory is matched by pnpm-workspace.yaml.
  2. Confirm its package.json name matches the dependency key exactly.
  3. Re-run pnpm install from the repo root.
pnpm-workspace.yaml
packages:
  - 'apps/*'
  - 'packages/*'

Reference the workspace package correctly

Use the workspace protocol with the exact package name so pnpm links the local copy instead of the registry.

package.json
{
  "dependencies": { "@acme/utils": "workspace:*" }
}

How to prevent it

  • Keep pnpm-workspace.yaml globs in sync with your directory layout.
  • Match each package name to how dependents reference it.
  • Run pnpm install from the repo root so all workspace members are discovered.

Related guides

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