Skip to content

[Bug?]: inter-workspace dependencies are not properly resolved when installing a package from git #6732

@MOZGIII

Description

@MOZGIII

Self-service

  • I'd be willing to implement a fix

Describe the bug

Yarn doesn't look for the workspace dependency of a dependency installed from git in that workspace, and tries to look for it at the registry instead.

To reproduce

  1. Have a workspace (@repo-a/root) in a github repo github.com/user/repo-a.
  2. In this workspace, have @repo-a/package-1 and @repo-a/package-2.
  3. Have @repo-a/package-1 depend on @repo-a/package-2 with workspace:^.
  4. Have a github repo github.com/user/repo-b with a package @repo-b/root.
  5. At the @repo-b/root add a dependency to @repo-a/package-1 as "@repo-a/package-1": "git@github.com:user/repo-a.git#workspace=@repo-a/package-1"
  6. Observe yarn install fail to resolve @repo-a/package-2 and fail the install @repo-a/package-1 because of it.

Environment

  System:
    OS: macOS 15.1.1
    CPU: (8) arm64 Apple M1
  Binaries:
    Node: 22.13.0 - /private/var/folders/cn/860vwq3j5zv_7_vzbtdfq9h40000gn/T/xfs-4e1f5446/node
    Yarn: 3.8.7 - /private/var/folders/cn/860vwq3j5zv_7_vzbtdfq9h40000gn/T/xfs-4e1f5446/yarn
    npm: 10.9.2 - /opt/homebrew/opt/node@22/bin/npm
    bun: 1.1.8 - ~/.bun/bin/bun

Additional context

This was brought up before but was closed without a solution due to being stale - #4545. The problem still exists and didn't go away.

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