Skip to content

[Bug?]: yarn fails to symlink in-range workspace dependency #7260

Open

Description

@trusktr

Self-service

  • I'd be willing to implement a fix

Describe the bug

Project A depends on B@^5.0.0.

Project B is at 5.2.0.

5.2.0 satisfies the range ^5.0.0, however Yarn does not link B into node_modules of A.

Workaround

To fix the issue, A's dependency has to be changed to B@^5.2.0, defeating the purpose of using a range.

To reproduce

TODO. Let me know if this is expected or seems like a bug. I'll make a repro.

Environment

System:
    OS: macOS 26.5
    CPU: (8) arm64 Apple M2
  Binaries:
    Node: 26.7.0 - /private/var/folders/7y/wy4mhdj114g5xj1ktvh6hdz80000gn/T/xfs-0176e10c/node
    Yarn: 4.18.0 - /private/var/folders/7y/wy4mhdj114g5xj1ktvh6hdz80000gn/T/xfs-0176e10c/yarn
    npm: 12.0.2 - /Users/trusktr/.npm-global/bin/npm
    pnpm: 10.24.0 - /Users/trusktr/.npm-global/bin/pnpm
    Deno: 1.38.3 - /opt/homebrew/bin/deno

Additional context

No response

Activity

  1. clemyan commented on Aug 21, 2026

    @clemyan
    Member

    By "Project A" and "Project B", do you mean two workspaces of the same project?

    Two possibilities come to mind:

    • The symlink may be hoisted to a node_modules above the dependent workspace
    • If enableTransparentWorkspaces is false, then a semver range will not resolve to a workspace and fall back to fetching from npm

    Not sure if I'm missing something, but if it is neither then it does sound like a bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions