Skip to content

Relax redis peer dependency to allow redis@^5 (in peerOptionalDependencies) #11528

Closed

Description

@StefaniOSApps

Problem

The current peerOptionalDependencies entry for redis in TypeORM v0.3.23 is:

"redis": "^3.1.1 || ^4.0.0"

This blocks installation with [email protected] under strict npm resolution (e.g. npm v7+), even though Redis is only required when using TypeORM's cache feature.

Why this matters

Many users rely on [email protected] directly (e.g. for Streams, Pub/Sub, etc.) and don't use TypeORM's Redis integration at all. Still, installation fails unless using --legacy-peer-deps.

This restriction creates unnecessary friction for setups where TypeORM and Redis are both used — independently.

Suggested fix

Relax the peerOptional range in package.json:

"redis": "^3.1.1 || ^4.0.0 || ^5.0.0"

Or ideally:

"redis": "*"

...since it's an optional peer and not a hard requirement.

Environment

  • typeorm: 0.3.23
  • redis: 5.5.6
  • node: 22.x
  • npm: 10.x

Activity

  1. alumni commented on Jun 15, 2025

    @alumni
    Collaborator

    Feel free to create a PR that adds v5 to the list of accepted versions.

    One thing though: the v5 client introduces some breaking changes: https://github.com/redis/node-redis/releases/tag/redis%405.0.0 - would the RedisQueryResultCache still work? The first thing that I see it's different is legacyMode. So the breaking changes would need to be taken care of.

  2. added a commit that references this issue on Jul 6, 2025
    b848ddb
  3. added a commit that references this issue on Aug 1, 2025
    522e06e
  4. added a commit that references this issue on Aug 1, 2025
    17cf837
  5. added a commit that references this issue on Dec 2, 2025
    e505950
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions