Skip to content

[Bug?]: yarn up replaces catalog: references in package.json instead of updating the catalog #7084

@emiliosheinz

Description

@emiliosheinz

Self-service

  • I'd be willing to implement a fix

Describe the bug

We are using Yarn catalogs to centralize dependency versions in a monorepo. The expected behavior is that upgrade commands update the catalog entries (in .yarnrc.yml) rather than rewriting package.json dependencies that use the catalog: protocol.

However, running yarn up with explicit versions breaks this expectation.

To reproduce

Given a catalog like:

catalog:
  react: 19.2.1

And a workspace package using:

{
  "dependencies": {
    "react": "catalog:"
  }
}

Running:

yarn up react@19.2.4

Rewrites package.json entries to the following:**

"react": "19.2.4"

Instead, the catalog entry should be updated, and the package.json should remain unchanged.

Environment

System:
  OS: macOS 26.3
  CPU: (14) arm64 Apple M4 Max
Binaries:
  Node: 22.18.0 - /private/var/folders/c2/r9vhzjgn15b5b5xcb6krf4th0000gp/T/xfs-9ca2a751/node
  Yarn: 4.12.0 - /private/var/folders/c2/r9vhzjgn15b5b5xcb6krf4th0000gp/T/xfs-9ca2a751/yarn
  npm: 10.9.3 - /Users/spoke/.volta/tools/image/node/22.18.0/bin/npm

Related issues

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