Skill: Workspace Dependency Check
Goal
Identify why a package cannot be resolved in a pnpm workspace and apply the correct fix.
Use This Skill When
- You see
Module not foundorERR_MODULE_NOT_FOUNDin a workspace. - A local package import fails in a monorepo.
Do Not Use This Skill When
- You are installing a public registry package for the first time.
Steps
- Locate Package:
- Find the package
package.jsonand confirm itsname.
- Find the package
- Check Workspace Config:
- Ensure
pnpm-workspace.yamlincludes the package path.
- Ensure
- Check Build Outputs:
- Confirm
main/exportspoint to existing files.
- Confirm
- Check Consumer:
- Verify the consumer lists the dependency in
package.json.
- Verify the consumer lists the dependency in
- Fix:
- Add the dependency or build the target package as needed.
Output
- A clear diagnosis and a correct fix action.
Strong Hints
- Constraint: Never install a local workspace package from the public registry.
- Tip:
exportsblocks can prevent deep imports that are not explicitly exported.
