Skip to content

Missing peer dependency ajv in better-ajv-errors causes installation failures #2444

@aklkv

Description

@aklkv

Describe the bug

When installing @redocly/cli in strict peer dependency environments, the installation fails because better-ajv-errors (a transitive dependency via @redocly/respect-core) declares ajv as a peer dependency, but it's not installed or made available by the parent package. This causes the installation to fail when strictPeerDependencies: true is enabled.

To Reproduce

  1. Create a pnpm-workspace.yaml with strictPeerDependencies: true
  2. Add @redocly/cli as a dependency to a workspace package
  3. Run pnpm install with strict peer dependency checking enabled
  4. See the error:
ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies

└─┬ @redocly/cli 1.34.2
└─┬ @redocly/respect-core 1.34.2
└─┬ better-ajv-errors 1.2.0
└── ✕ missing peer ajv@"4.11.8 - 8"

Expected behavior

Installation should succeed with strict peer dependency checking enabled. @redocly/respect-core should add ajv as a dependency to ensure it's available for better-ajv-errors.

Logs

ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies

└─┬ @redocly/cli 1.34.2
└─┬ @redocly/respect-core 1.34.2
└─┬ better-ajv-errors 1.2.0
└── ✕ missing peer ajv@"4.11.8 - 8"

Redocly version(s)*

@redocly/[email protected]

Node.js version(s)

Node.js 22

OS, environment

Docker container and CI environments with strict peer dependency checking

Additional context

This issue occurs in environments where pnpm is configured with strictPeerDependencies: true (a best practice for dependency management). The missing peer dependency prevents automated builds and containerized deployments from succeeding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions