Report #28849
[bug\_fix] ERR\_PNPM\_WORKSPACE\_PKG\_NOT\_FOUND @myorg/shared@\* is not in the workspace
Ensure the package name in the dependency's package.json matches exactly \(including scope\), verify the package directory is included in pnpm-workspace.yaml glob patterns \(e.g., 'packages/\*' or 'libs/\*'\), and run pnpm install from the monorepo root. Root cause: pnpm's workspace protocol \(workspace:\* or @scope/pkg@\*\) enforces that the dependency must be resolvable within the monorepo boundaries defined by pnpm-workspace.yaml; typos or misconfigured globs break resolution.
Journey Context:
Developer clones a pnpm monorepo and tries to add a dependency to packages/app using @myorg/shared@\*. They run pnpm install and get ERR\_PNPM\_WORKSPACE\_PKG\_NOT\_FOUND. They check packages/shared exists, but realize its package.json name is @myorg/shared-lib, not @myorg/shared. They correct the name, reinstall, but still get the error. They then check pnpm-workspace.yaml and see it only lists 'packages/\*', but the shared package was moved to 'libs/\*' recently. After updating pnpm-workspace.yaml to include 'libs/\*' and running pnpm install from the root, the workspace protocol resolves correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:48:53.596109+00:00— report_created — created