pnpm workspace package not found (workspace:*) in CI
pnpm could not resolve a workspace:* dependency because no local package matches that name. The package was renamed, is outside the workspace globs, or its package.json is missing.
What this error means
pnpm install fails resolving a workspace dependency: "In <pkg>: \"@acme/ui@workspace:*\" is in the dependencies but no package named @acme/ui is in this workspace".
pnpm
ERR_PNPM_NO_MATCHING_VERSION_INSIDE_WORKSPACE In apps/web:
"@acme/ui@workspace:*" is in the dependencies but no package named
"@acme/ui" is present in the workspaceCommon causes
Package renamed
The dependency uses an old name no local package declares anymore.
Package outside workspace globs
pnpm-workspace.yaml packages globs do not cover the package directory, so it is not in the workspace.
Missing or wrong package.json name
The target package has no package.json or a different name field than the dependency expects.
How to fix it
List workspace packages
- Confirm the package name pnpm sees.
Terminal
pnpm -r ls --depth -1Fix the glob or the name
- Add the directory to pnpm-workspace.yaml packages.
- Align the dependency name with the package name field.
pnpm-workspace.yaml
packages:
- 'apps/*'
- 'packages/*'How to prevent it
- Keep pnpm-workspace.yaml globs covering every package and update dependents after any rename.
Related guides
npm ERR! workspace not found in CIFix "npm ERR! No workspaces found" / workspace not found in CI. A --workspace name or path does not match any…
Yarn "Workspace doesn't exist" in CIFix Yarn "Workspace X doesn't exist" in CI. The yarn workspace name does not match any package in the workspa…
workspace: protocol not supported (npm version) in CIFix "Unsupported URL Type workspace:" in CI. An older npm (or a tool that does not understand the workspace p…