Skip to content

TypeError: Invalid comparator: catalog: when using catalog: protocols and a non-latest --target #1765

@duniul

Description

@duniul

Steps to Reproduce

Dependencies:

pnpm-workspace.yaml:

packages:
  - 'packages/**'

catalog:
  ncu-test-tag: '1.0.0'

packages/a/package.json:

{
  "dependencies": {
    "ncu-test-tag": "catalog:"
  }
}

(an empty pnpm-lock.yaml is present so pnpm is detected)

Steps:

  1. Run ncu -w --target minor

Current Behavior

Every dependency that uses a catalog: reference in a workspace package.json is reported as an error in the output table:

Checking packages/a/package.json
 ncu-test-tag  TypeError: Invalid comparator: catalog:

Checking pnpm-workspace.yaml catalog dependencies
 ncu-test-tag  1.0.0  →  1.1.0

The same seems to happen with other targets than 'latest' for catalog: dependencies.

The default (--target latest) does not throw any errors.

Expected Behavior

ncu -w --target minor should match the --target latest behavior: silently skip the non-registry references in the workspace package.json and only upgrade the catalog entry in pnpm-workspace.yaml. No per-dependency TypeError rows in the table.

Environment

  • node: v24.13.0
  • pnpm: 11.3.0
  • npm-check-updates: 22.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions