[GH-ISSUE #6860] Old @prisma/client@"^5.22.0" dependency in better-auth 1.4.7 #27979

Closed
opened 2026-04-17 19:17:45 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @nicolo-tito on GitHub (Dec 18, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/6860

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Create package.json with
"dependencies": {
    "@prisma/client": "^7.2.0",
    "better-auth": "^1.4.7"
}
  1. Run npm i

Current vs. Expected behavior

Current:

npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: better-auth@1.4.7
npm error Found: @prisma/client@7.2.0
npm error node_modules/@prisma/client
npm error   @prisma/client@"^7.2.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peerOptional @prisma/client@"^5.22.0" from better-auth@1.4.7
npm error node_modules/better-auth
npm error   better-auth@"^1.4.7" from the root project
npm error
npm error Conflicting peer dependency: @prisma/client@5.22.0
npm error node_modules/@prisma/client
npm error   peerOptional @prisma/client@"^5.22.0" from better-auth@1.4.7
npm error   node_modules/better-auth
npm error     better-auth@"^1.4.7" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

Expected no error

What version of Better Auth are you using?

1.4.7

System info

{
  "system": {
    "platform": "win32",
    "arch": "x64",
    "version": "Windows 11 Pro",
    "release": "10.0.26200",
    "cpuCount": 24,
    "cpuModel": "Intel(R) Core(TM) Ultra 9 275HX",
    "totalMemory": "63.43 GB",
    "freeMemory": "32.54 GB"
  },
  "node": {
    "version": "v24.11.1",
    "env": "development"
  },
  "packageManager": {
    "name": "npm",
    "version": "11.6.4"
  },
  "frameworks": [
    {
      "name": "next",
      "version": "^16.0.10"
    },
    {
      "name": "react",
      "version": "^19"
    }
  ],
  "databases": [
    {
      "name": "pg",
      "version": "^8.16.3"
    },
    {
      "name": "@prisma/client",
      "version": "^7.2.0"
    }
  ],
  "betterAuth": {
    "version": "^1.4.7",
    "config": null
  }
}

Which area(s) are affected? (Select all that apply)

Package

Auth config (if applicable)


Additional context

1.4.6 doesn't have the same issue

No response

Originally created by @nicolo-tito on GitHub (Dec 18, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/6860 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Create package.json with ```json "dependencies": { "@prisma/client": "^7.2.0", "better-auth": "^1.4.7" } ``` 2. Run npm i ### Current vs. Expected behavior Current: ``` npm error code ERESOLVE npm error ERESOLVE could not resolve npm error npm error While resolving: better-auth@1.4.7 npm error Found: @prisma/client@7.2.0 npm error node_modules/@prisma/client npm error @prisma/client@"^7.2.0" from the root project npm error npm error Could not resolve dependency: npm error peerOptional @prisma/client@"^5.22.0" from better-auth@1.4.7 npm error node_modules/better-auth npm error better-auth@"^1.4.7" from the root project npm error npm error Conflicting peer dependency: @prisma/client@5.22.0 npm error node_modules/@prisma/client npm error peerOptional @prisma/client@"^5.22.0" from better-auth@1.4.7 npm error node_modules/better-auth npm error better-auth@"^1.4.7" from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution. ``` Expected no error ### What version of Better Auth are you using? 1.4.7 ### System info ```bash { "system": { "platform": "win32", "arch": "x64", "version": "Windows 11 Pro", "release": "10.0.26200", "cpuCount": 24, "cpuModel": "Intel(R) Core(TM) Ultra 9 275HX", "totalMemory": "63.43 GB", "freeMemory": "32.54 GB" }, "node": { "version": "v24.11.1", "env": "development" }, "packageManager": { "name": "npm", "version": "11.6.4" }, "frameworks": [ { "name": "next", "version": "^16.0.10" }, { "name": "react", "version": "^19" } ], "databases": [ { "name": "pg", "version": "^8.16.3" }, { "name": "@prisma/client", "version": "^7.2.0" } ], "betterAuth": { "version": "^1.4.7", "config": null } } ``` ### Which area(s) are affected? (Select all that apply) Package ### Auth config (if applicable) ```typescript ``` ### Additional context 1.4.6 doesn't have the same issue _No response_
GiteaMirror added the locked label 2026-04-17 19:17:45 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Dec 18, 2025):

Hi there! Thanks for reporting this dependency conflict issue. The error occurs because Better Auth 1.4.7 currently has an optional peer dependency on @prisma/client@"^5.22.0", while your project uses version 7.2.0. In this situation, you have a couple of options:

• You can temporarily resolve the conflict by using npm’s --legacy-peer-deps (or --force) flag when installing, which will bypass the strict peer dependency check.
• Alternatively, you could downgrade your @prisma/client version to 5.22.0 if that’s acceptable for your project, to fully satisfy the peer requirement.

If you’d like Better Auth to support newer versions of @prisma/client, please consider tagging @bekacru and @ping__ so they can take a closer look at this issue.

tag @better-auth-agent if you would like an answer from the Agent

What additional details can we help you with regarding this issue?

If you need more help, tag @better-auth-agent in a comment so I can respond.

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3670672481 --> @better-auth-agent[bot] commented on GitHub (Dec 18, 2025): Hi there! Thanks for reporting this dependency conflict issue. The error occurs because Better Auth 1.4.7 currently has an optional peer dependency on @prisma/client@"^5.22.0", while your project uses version 7.2.0. In this situation, you have a couple of options: • You can temporarily resolve the conflict by using npm’s --legacy-peer-deps (or --force) flag when installing, which will bypass the strict peer dependency check. • Alternatively, you could downgrade your @prisma/client version to 5.22.0 if that’s acceptable for your project, to fully satisfy the peer requirement. If you’d like Better Auth to support newer versions of @prisma/client, please consider tagging @bekacru and @ping__ so they can take a closer look at this issue. tag @better-auth-agent if you would like an answer from the Agent What additional details can we help you with regarding this issue? _If you need more help, tag @better-auth-agent in a comment so I can respond._ <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) • [Discord](https://discord.gg/fG2XXEuQX3) • [GitHub](https://github.com/Skyvern-AI/Skyvern) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/fG2XXEuQX3) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/Skyvern-AI/Skyvern)
Author
Owner

@dosubot[bot] commented on GitHub (Dec 18, 2025):

The npm ERESOLVE error happens because better-auth@1.4.7 pins its peer dependency on @prisma/client to ^5.22.0, which blocks installation with Prisma 7.x—even though Prisma 7 is fundamentally compatible if you bypass peer checks. This strict constraint was introduced in 1.4.7; earlier versions like 1.4.6 supported Prisma 6 and 7 without this problem. Maintainers are aware and have merged a fix to relax the peer dependency range, which will be available in the next release—so you won’t need workarounds once that’s published (source, source).

For now, you have three options: downgrade to better-auth@1.4.6 (recommended for Prisma 7), use npm install --legacy-peer-deps to bypass the check, or try pnpm as your package manager (not guaranteed). If you must use 1.4.7 with Prisma 7, manual steps are required after every CLI run—like updating schema files and generator blocks—since the CLI doesn’t fully support Prisma 7 yet (details).

You can track progress or get more details in these threads: #6746, #6820, and open PRs.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

<!-- gh-comment-id:3670683676 --> @dosubot[bot] commented on GitHub (Dec 18, 2025): <!-- Answer --> The npm ERESOLVE error happens because better-auth@1.4.7 pins its peer dependency on @prisma/client to ^5.22.0, which blocks installation with Prisma 7.x—even though Prisma 7 is fundamentally compatible if you bypass peer checks. This strict constraint was introduced in 1.4.7; earlier versions like 1.4.6 supported Prisma 6 and 7 without this problem. Maintainers are aware and have merged a fix to relax the peer dependency range, which will be available in the next release—so you won’t need workarounds once that’s published ([source](https://github.com/better-auth/better-auth/issues/6746), [source](https://github.com/better-auth/better-auth/issues/6820)). For now, you have three options: downgrade to better-auth@1.4.6 (recommended for Prisma 7), use `npm install --legacy-peer-deps` to bypass the check, or try pnpm as your package manager (not guaranteed). If you must use 1.4.7 with Prisma 7, manual steps are required after every CLI run—like updating schema files and generator blocks—since the CLI doesn’t fully support Prisma 7 yet ([details](https://github.com/better-auth/better-auth/issues/6746#issuecomment-3650689067)). You can track progress or get more details in these threads: [#6746](https://github.com/better-auth/better-auth/issues/6746), [#6820](https://github.com/better-auth/better-auth/issues/6820), and [open PRs](https://github.com/better-auth/better-auth/pull/6596). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/716f883d-62d3-46ca-b0fd-9fadd1288a90?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/716f883d-62d3-46ca-b0fd-9fadd1288a90?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/716f883d-62d3-46ca-b0fd-9fadd1288a90?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/716f883d-62d3-46ca-b0fd-9fadd1288a90?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/716f883d-62d3-46ca-b0fd-9fadd1288a90?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/716f883d-62d3-46ca-b0fd-9fadd1288a90?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/716f883d-62d3-46ca-b0fd-9fadd1288a90?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20npm%20ERESOLVE%20error%20happens%20because%20better-auth%401.4.7%20pins%20its%20peer%20dependency%20on%20%40prisma/client%20to%20%5E5.22.0%2C%20which%20blocks%20installation%20with%20Prisma%207.x%E2%80%94even%20though%20Prisma%207%20is%20fundamentally%20compatible%20if%20you%20bypass%20peer%20checks.%20This%20strict%20constraint%20was%20introduced%20in%201.4.7%3B%20earlier%20versions%20like%201.4.6%20supported%20Prisma%206%20and%207%20without%20this%20problem.%20Maintainers%20are%20aware%20and%20have%20merged%20a%20fix%20to%20relax%20the%20peer%20dependency%20range%2C%20which%20will%20be%20available%20in%20the%20next%20release%E2%80%94so%20you%20won%E2%80%99t%20need%20workarounds%20once%20that%E2%80%99s%20published%20%28%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/issues/6746%29%2C%20%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/issues/6820%29%29.%0A%0AFor%20now%2C%20you%20have%20three%20options%3A%20downgrade%20to%20better-auth%401.4.6%20%28recommended%20for%20Prisma%207%29%2C%20use%20%60npm%20install%20--legacy-peer-deps%60%20to%20bypass%20the%20check%2C%20or%20try%20pnpm%20as%20your%20package%20manager%20%28not%20guaranteed%29.%20If%20you%20must%20use%201.4.7%20with%20Prisma%207%2C%20manual%20steps%20are%20required%20after%20every%20CLI%20run%E2%80%94like%20updating%20schema%20files%20and%20generator%20blocks%E2%80%94since%20the%20CLI%20doesn%E2%80%99t%20fully%20support%20Prisma%207%20yet%20%28%5Bdetails%5D%28https%3A//github.com/better-auth/better-auth/issues/6746%23issuecomment-3650689067%29%29.%20%0A%0AYou%20can%20track%20progress%20or%20get%20more%20details%20in%20these%20threads%3A%20%5B%236746%5D%28https%3A//github.com/better-auth/better-auth/issues/6746%29%2C%20%5B%236820%5D%28https%3A//github.com/better-auth/better-auth/issues/6820%29%2C%20and%20%5Bopen%20PRs%5D%28https%3A//github.com/better-auth/better-auth/pull/6596%29.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/6860)
Author
Owner

@nicolo-tito commented on GitHub (Dec 18, 2025):

Hi @Bekacru and @ping__, just opening the issue to inform that this is a regression in 1.4.7, no problems with 1.4.6. Thanks!

<!-- gh-comment-id:3670690805 --> @nicolo-tito commented on GitHub (Dec 18, 2025): Hi @Bekacru and @ping__, just opening the issue to inform that this is a regression in 1.4.7, no problems with 1.4.6. Thanks!
Author
Owner

@nicolo-tito commented on GitHub (Dec 18, 2025):

Closing as duplicate of #6820

<!-- gh-comment-id:3670821352 --> @nicolo-tito commented on GitHub (Dec 18, 2025): Closing as duplicate of #6820
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#27979