[GH-ISSUE #6820] Dependency resolution fails with Prisma v7 (ERESOLVE) #19274

Closed
opened 2026-04-15 18:09:08 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @pranav-bhatkar on GitHub (Dec 17, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/6820

Installing better-auth fails due to a peer dependency conflict with Prisma v7.

better-auth@1.4.7 declares a peer dependency on prisma@^5.22.0, but the project uses prisma@7.1.0.
npm is unable to resolve the dependency tree and aborts the install.

Steps to Reproduce

npm install better-auth

Environment

  • Node.js: 24.4.1
  • npm: 11.4.2
  • better-auth: 1.4.7
  • prisma: 7.1.0
  • @prisma/client: 7.1.0
  • drizzle-orm: 0.41.0
  • OS: Linux

Error Output

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree

While resolving: edutech-backend-new@0.0.1
Found: prisma@7.1.0
node_modules/prisma
  dev prisma@"^7.1.0" from the root project
  peerOptional prisma@"*" from @prisma/client@7.1.0

Could not resolve dependency:
peerOptional prisma@"^5.22.0" from better-auth@1.4.7
node_modules/better-auth

Expected Behavior

better-auth should:

  • Either support Prisma v7, or
  • Relax the peer dependency range (e.g. >=5.22.0), or
  • Clearly document incompatibility with Prisma v7.

Actual Behavior

Installation fails unless using:

npm install better-auth --legacy-peer-deps

What is the recommended fix?

  • Downgrade Prisma to ^5.22.0?
  • Is Prisma v7 supported but the peer dependency not yet updated?
Originally created by @pranav-bhatkar on GitHub (Dec 17, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/6820 Installing `better-auth` fails due to a peer dependency conflict with Prisma v7. `better-auth@1.4.7` declares a peer dependency on `prisma@^5.22.0`, but the project uses `prisma@7.1.0`. npm is unable to resolve the dependency tree and aborts the install. ### Steps to Reproduce ```bash npm install better-auth ``` ### Environment * **Node.js:** 24.4.1 * **npm:** 11.4.2 * **better-auth:** 1.4.7 * **prisma:** 7.1.0 * **@prisma/client:** 7.1.0 * **drizzle-orm:** 0.41.0 * **OS:** Linux ### Error Output ```text npm error code ERESOLVE npm error ERESOLVE unable to resolve dependency tree While resolving: edutech-backend-new@0.0.1 Found: prisma@7.1.0 node_modules/prisma dev prisma@"^7.1.0" from the root project peerOptional prisma@"*" from @prisma/client@7.1.0 Could not resolve dependency: peerOptional prisma@"^5.22.0" from better-auth@1.4.7 node_modules/better-auth ``` ### Expected Behavior `better-auth` should: * Either support Prisma v7, or * Relax the peer dependency range (e.g. `>=5.22.0`), or * Clearly document incompatibility with Prisma v7. ### Actual Behavior Installation fails unless using: ```bash npm install better-auth --legacy-peer-deps ``` What is the recommended fix? - Downgrade Prisma to ^5.22.0? - Is Prisma v7 supported but the peer dependency not yet updated?
GiteaMirror added the lockeddatabasebug labels 2026-04-15 18:09:08 -05:00
Author
Owner

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

Hi there, thanks for opening this issue! The error indicates that better‑auth@1.4.7 expects Prisma version ^5.22.0, which creates a conflict when using Prisma v7. At this time, it appears that Prisma v7 isn’t officially supported, so the recommended workarounds are either to downgrade your Prisma version to one within the supported range or to install using the --legacy‑peer‑deps flag as you’ve noted.

Some users have seen success with the legacy flag, but if you need Prisma v7 features, you might need to wait for an update that relaxes the peer dependency or explicitly adds support for Prisma v7. Could you share more about your use case and any specific features you require from Prisma v7? Tag @better-auth-agent if you would like an answer from the Agent.

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

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3664413271 --> @better-auth-agent[bot] commented on GitHub (Dec 17, 2025): Hi there, thanks for opening this issue! The error indicates that better‑auth@1.4.7 expects Prisma version ^5.22.0, which creates a conflict when using Prisma v7. At this time, it appears that Prisma v7 isn’t officially supported, so the recommended workarounds are either to downgrade your Prisma version to one within the supported range or to install using the --legacy‑peer‑deps flag as you’ve noted. Some users have seen success with the legacy flag, but if you need Prisma v7 features, you might need to wait for an update that relaxes the peer dependency or explicitly adds support for Prisma v7. Could you share more about your use case and any specific features you require from Prisma v7? Tag @better-auth-agent if you would like an answer from the Agent. _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 17, 2025):

Hi @pranav-bhatkar! I'm Dosu and I’m helping the better-auth team.

better-auth now officially supports Prisma v7—recent updates expanded the peer dependency range to include Prisma v7, and the CLI/schema generator code detects and adapts to Prisma v7 requirements (source, source, source).

If you’re still seeing a peer dependency conflict, make sure you’re installing the latest published version of better-auth. If the error persists, clear your npm cache, delete node_modules and package-lock.json, and reinstall. You do not need to downgrade Prisma or rely on --legacy-peer-deps anymore.

If you’re forced to use an older version, manual workarounds are possible (like updating schema files and generator blocks after each CLI run), but official support for Prisma v7 is now present.

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:3664434035 --> @dosubot[bot] commented on GitHub (Dec 17, 2025): <!-- Greeting --> Hi @pranav-bhatkar! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> better-auth now officially supports Prisma v7—recent updates expanded the peer dependency range to include Prisma v7, and the CLI/schema generator code detects and adapts to Prisma v7 requirements ([source](https://github.com/better-auth/better-auth/pull/6751), [source](https://github.com/better-auth/better-auth/blob/1010192e4a7106bfccca02c5fda312adc5ac0593/packages/better-auth/package.json#L463-L561), [source](https://github.com/better-auth/better-auth/blob/1010192e4a7106bfccca02c5fda312adc5ac0593/packages/cli/src/generators/prisma.ts#L42-L485)). If you’re still seeing a peer dependency conflict, make sure you’re installing the latest published version of better-auth. If the error persists, clear your npm cache, delete node_modules and package-lock.json, and reinstall. You do not need to downgrade Prisma or rely on --legacy-peer-deps anymore. If you’re forced to use an older version, manual workarounds are possible (like updating schema files and generator blocks after each CLI run), but official support for Prisma v7 is now present. <!-- 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/7e55fb2b-37aa-4a5e-a180-7a067e096ca2?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/7e55fb2b-37aa-4a5e-a180-7a067e096ca2?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/7e55fb2b-37aa-4a5e-a180-7a067e096ca2?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/7e55fb2b-37aa-4a5e-a180-7a067e096ca2?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7e55fb2b-37aa-4a5e-a180-7a067e096ca2?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/7e55fb2b-37aa-4a5e-a180-7a067e096ca2?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7e55fb2b-37aa-4a5e-a180-7a067e096ca2?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=better-auth%20now%20officially%20supports%20Prisma%20v7%E2%80%94recent%20updates%20expanded%20the%20peer%20dependency%20range%20to%20include%20Prisma%20v7%2C%20and%20the%20CLI/schema%20generator%20code%20detects%20and%20adapts%20to%20Prisma%20v7%20requirements%20%28%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/pull/6751%29%2C%20%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/blob/1010192e4a7106bfccca02c5fda312adc5ac0593/packages/better-auth/package.json%23L463-L561%29%2C%20%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/blob/1010192e4a7106bfccca02c5fda312adc5ac0593/packages/cli/src/generators/prisma.ts%23L42-L485%29%29.%20%0A%0AIf%20you%E2%80%99re%20still%20seeing%20a%20peer%20dependency%20conflict%2C%20make%20sure%20you%E2%80%99re%20installing%20the%20latest%20published%20version%20of%20better-auth.%20If%20the%20error%20persists%2C%20clear%20your%20npm%20cache%2C%20delete%20node_modules%20and%20package-lock.json%2C%20and%20reinstall.%20You%20do%20not%20need%20to%20downgrade%20Prisma%20or%20rely%20on%20--legacy-peer-deps%20anymore.%0A%0AIf%20you%E2%80%99re%20forced%20to%20use%20an%20older%20version%2C%20manual%20workarounds%20are%20possible%20%28like%20updating%20schema%20files%20and%20generator%20blocks%20after%20each%20CLI%20run%29%2C%20but%20official%20support%20for%20Prisma%20v7%20is%20now%20present.)&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/6820)
Author
Owner

@jslno commented on GitHub (Dec 17, 2025):

A fix is already merged, it'll land in the next release

<!-- gh-comment-id:3664884974 --> @jslno commented on GitHub (Dec 17, 2025): A fix is already merged, it'll land in the next release
Author
Owner

@iiindexxx commented on GitHub (Dec 19, 2025):

@jslno do you have any idea when the next release wil be out?

<!-- gh-comment-id:3675354873 --> @iiindexxx commented on GitHub (Dec 19, 2025): @jslno do you have any idea when the next release wil be out?
Author
Owner

@jslno commented on GitHub (Dec 19, 2025):

It should already be fixed in 1.4.8-beta

<!-- gh-comment-id:3676065740 --> @jslno commented on GitHub (Dec 19, 2025): It should already be fixed in 1.4.8-beta
Author
Owner

@dosubot[bot] commented on GitHub (Mar 20, 2026):

Hi, @pranav-bhatkar. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a peer dependency conflict when installing better-auth@1.4.7 with Prisma v7 due to version requirements.
  • The maintainers confirmed that official support for Prisma v7 was added in version 1.4.8-beta.
  • The fix expanded the peer dependency range and updated the CLI/schema generator accordingly.
  • Users are advised to update to version 1.4.8-beta and clear caches if conflicts persist.

Next Steps:

  • Please confirm if this issue is still relevant with the latest version of better-auth.
  • If it is, you can keep the discussion open by commenting; otherwise, I will automatically close this issue in 7 days.

Thank you for your understanding and contribution!

<!-- gh-comment-id:4099281164 --> @dosubot[bot] commented on GitHub (Mar 20, 2026): Hi, @pranav-bhatkar. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a peer dependency conflict when installing better-auth@1.4.7 with Prisma v7 due to version requirements. - The maintainers confirmed that official support for Prisma v7 was added in version 1.4.8-beta. - The fix expanded the peer dependency range and updated the CLI/schema generator accordingly. - Users are advised to update to version 1.4.8-beta and clear caches if conflicts persist. **Next Steps:** - Please confirm if this issue is still relevant with the latest version of better-auth. - If it is, you can keep the discussion open by commenting; otherwise, I will automatically close this issue in 7 days. Thank you for your understanding and contribution!
Author
Owner

@github-actions[bot] commented on GitHub (Apr 4, 2026):

This issue has been locked as it was closed more than 7 days ago. If you're experiencing a similar problem or you have additional context, please open a new issue and reference this one.

<!-- gh-comment-id:4185771102 --> @github-actions[bot] commented on GitHub (Apr 4, 2026): This issue has been locked as it was closed more than 7 days ago. If you're experiencing a similar problem or you have additional context, please open a new issue and reference this one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#19274