link-workspace-packages

Link workspace packages across npm, yarn, pnpm, and bun monorepos.

27|7|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/nrwl/nx-ai-agents-config --skill link-workspace-packages-nrwl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: link-workspace-packages
Source: https://github.com/nrwl/nx-ai-agents-config/tree/main/generated/.cursor/skills/link-workspace-packages
Command: npx skills add https://github.com/nrwl/nx-ai-agents-config --skill link-workspace-packages-nrwl

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill resolves dependency issues and ensures proper linking between packages in a monorepo, preventing "cannot find module" errors and improving build stability.

Core Features & Use Cases

  • Automated Dependency Management: Adds necessary dependencies between workspace packages using the correct syntax for npm, yarn, pnpm, and bun.
  • Resolution Error Fixes: Directly addresses common import and resolution errors like TS2307 by ensuring packages are correctly linked.
  • Use Case: After generating a new UI component library and a dashboard that uses it, this Skill can be used to automatically add the UI library as a dependency to the dashboard, ensuring they work together correctly.

Quick Start

Use the link-workspace-packages skill to add the @org/ui package as a dependency to the @org/app package.

Frequently Asked Questions about link-workspace-packages

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix 'cannot find module' errors when importing packages in a monorepo?

To fix 'cannot find module' errors in a monorepo, you must properly link workspace packages by declaring package interdependencies and utilizing package manager-specific commands to establish symlinks across npm, yarn, pnpm, or bun.

How do I link workspace packages across different package managers like npm, yarn, pnpm, and bun?

Linking workspace packages requires using the correct syntax and commands specific to your package manager—npm, yarn, pnpm, or bun—to establish symlinks and manage dependencies within the monorepo structure.

Why does TypeScript throw resolution errors like TS2307 for my monorepo dependencies?

TypeScript throws resolution errors like TS2307 because workspace packages are not properly linked or declared as dependencies. Ensuring correct package interdependencies are declared and managed resolves these import errors.

Does this monorepo linking approach work with both pnpm and bun?

Yes, this approach works with pnpm and bun, as well as npm and yarn. It utilizes package manager-specific commands to establish symlinks and manage dependencies across various monorepo structures.

What is the best way to add a shared UI library as a dependency to an app in a monorepo?

The best way to add a shared library to an app in a monorepo is by properly declaring the package interdependency and using your specific package manager's workspace linking commands to establish the necessary symlinks.

Monorepo package linking is not working, what are common limitations or causes?

Monorepo package linking fails when necessary dependencies between workspace packages are not declared using the correct syntax for your specific package manager, or when symlinks are not properly established within the monorepo structure.