how to remove the automatic installation of this better-sqlite3 #2808

Closed
opened 2026-03-13 10:21:29 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @heshine0 on GitHub (Feb 2, 2026).

Is this suited for github?

  • Yes, this is suited for github

It's about a docker build project where installing better-sqlite3 is particularly slow because it also requires a Python compilation environment. How can I remove the automatic installation of this better-sqlite3 since I'm not using sqlite3?

Describe the solution you'd like

Remove the automatic installation of this better-sqlite3 when the project doesn't use it.

Describe alternatives you've considered

Remove the automatic installation of this better-sqlite3 when the project doesn't use it.

Additional context

****@Shine:~/projects/sso-auth$ bun why better-sqlite3
[0.12ms] ".env"
better-sqlite3@12.6.2
  ├─ @better-auth/cli@1.4.18 (requires ^12.2.0)
  │  └─ dev sso-auth (requires ^1.4.18)
  ├─ optional peer better-auth@1.4.18 (requires ^12.0.0)
  │  ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18)
  │  │  └─ sso-auth (requires ^1.4.18)
  │  ├─ @better-auth/cli@1.4.18 (requires ^1.4.18)
  │  │  └─ dev sso-auth (requires ^1.4.18)
  │  └─ sso-auth (requires ^1.4.18)
  │  
  ├─ optional peer drizzle-orm@0.41.0 (requires >=7)
  │  ├─ @better-auth/cli@1.4.18 (requires ^0.41.0)
  │  │  └─ dev sso-auth (requires ^1.4.18)
  │  └─ optional peer better-auth@1.4.18 (requires >=0.41.0)
  │     ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18)
  │     │  └─ sso-auth (requires ^1.4.18)
  │     ├─ @better-auth/cli@1.4.18 (requires ^1.4.18)
  │     │  └─ dev sso-auth (requires ^1.4.18)
  │     └─ sso-auth (requires ^1.4.18)
  │  
  └─ optional peer prisma@7.3.0 (requires >=9.0.0)
     ├─ optional peer better-auth@1.4.18 (requires ^5.0.0 || ^6.0.0 || ^7.0.0)
     │  ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18)
     │  │  └─ sso-auth (requires ^1.4.18)
     │  ├─ @better-auth/cli@1.4.18 (requires ^1.4.18)
     │  │  └─ dev sso-auth (requires ^1.4.18)
     │  └─ sso-auth (requires ^1.4.18)
     ├─ dev sso-auth (requires ^7.3.0)
     ├─ optional peer @prisma/client@7.3.0 (requires *)
     │  ├─ sso-auth (requires ^7.3.0)
     │  ├─ optional peer better-auth@1.4.18 (requires ^5.0.0 || ^6.0.0 || ^7.0.0)
     │  │  ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18)
     │  │  │  └─ sso-auth (requires ^1.4.18)
     │  │  ├─ @better-auth/cli@1.4.18 (requires ^1.4.18)
     │  │  │  └─ dev sso-auth (requires ^1.4.18)
     │  │  └─ sso-auth (requires ^1.4.18)
     │  └─ optional peer drizzle-orm@0.41.0 (requires *)
     │     ├─ @better-auth/cli@1.4.18 (requires ^0.41.0)
     │     │  └─ dev sso-auth (requires ^1.4.18)
     │     └─ optional peer better-auth@1.4.18 (requires >=0.41.0)
     │        ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18)
     │        │  └─ sso-auth (requires ^1.4.18)
     │        ├─ @better-auth/cli@1.4.18 (requires ^1.4.18)
     │        │  └─ dev sso-auth (requires ^1.4.18)
     │        └─ sso-auth (requires ^1.4.18)
     └─ optional peer @prisma/client@5.22.0 (requires *)
        └─ @better-auth/cli@1.4.18 (requires ^5.22.0)
           └─ dev sso-auth (requires ^1.4.18)

No response

Originally created by @heshine0 on GitHub (Feb 2, 2026). ### Is this suited for github? - [ ] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. It's about a docker build project where installing better-sqlite3 is particularly slow because it also requires a Python compilation environment. How can I remove the automatic installation of this better-sqlite3 since I'm not using sqlite3? ### Describe the solution you'd like Remove the automatic installation of this better-sqlite3 when the project doesn't use it. ### Describe alternatives you've considered Remove the automatic installation of this better-sqlite3 when the project doesn't use it. ### Additional context ```sh ****@Shine:~/projects/sso-auth$ bun why better-sqlite3 [0.12ms] ".env" better-sqlite3@12.6.2 ├─ @better-auth/cli@1.4.18 (requires ^12.2.0) │ └─ dev sso-auth (requires ^1.4.18) ├─ optional peer better-auth@1.4.18 (requires ^12.0.0) │ ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18) │ │ └─ sso-auth (requires ^1.4.18) │ ├─ @better-auth/cli@1.4.18 (requires ^1.4.18) │ │ └─ dev sso-auth (requires ^1.4.18) │ └─ sso-auth (requires ^1.4.18) │ ├─ optional peer drizzle-orm@0.41.0 (requires >=7) │ ├─ @better-auth/cli@1.4.18 (requires ^0.41.0) │ │ └─ dev sso-auth (requires ^1.4.18) │ └─ optional peer better-auth@1.4.18 (requires >=0.41.0) │ ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18) │ │ └─ sso-auth (requires ^1.4.18) │ ├─ @better-auth/cli@1.4.18 (requires ^1.4.18) │ │ └─ dev sso-auth (requires ^1.4.18) │ └─ sso-auth (requires ^1.4.18) │ └─ optional peer prisma@7.3.0 (requires >=9.0.0) ├─ optional peer better-auth@1.4.18 (requires ^5.0.0 || ^6.0.0 || ^7.0.0) │ ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18) │ │ └─ sso-auth (requires ^1.4.18) │ ├─ @better-auth/cli@1.4.18 (requires ^1.4.18) │ │ └─ dev sso-auth (requires ^1.4.18) │ └─ sso-auth (requires ^1.4.18) ├─ dev sso-auth (requires ^7.3.0) ├─ optional peer @prisma/client@7.3.0 (requires *) │ ├─ sso-auth (requires ^7.3.0) │ ├─ optional peer better-auth@1.4.18 (requires ^5.0.0 || ^6.0.0 || ^7.0.0) │ │ ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18) │ │ │ └─ sso-auth (requires ^1.4.18) │ │ ├─ @better-auth/cli@1.4.18 (requires ^1.4.18) │ │ │ └─ dev sso-auth (requires ^1.4.18) │ │ └─ sso-auth (requires ^1.4.18) │ └─ optional peer drizzle-orm@0.41.0 (requires *) │ ├─ @better-auth/cli@1.4.18 (requires ^0.41.0) │ │ └─ dev sso-auth (requires ^1.4.18) │ └─ optional peer better-auth@1.4.18 (requires >=0.41.0) │ ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18) │ │ └─ sso-auth (requires ^1.4.18) │ ├─ @better-auth/cli@1.4.18 (requires ^1.4.18) │ │ └─ dev sso-auth (requires ^1.4.18) │ └─ sso-auth (requires ^1.4.18) └─ optional peer @prisma/client@5.22.0 (requires *) └─ @better-auth/cli@1.4.18 (requires ^5.22.0) └─ dev sso-auth (requires ^1.4.18) ``` _No response_
GiteaMirror added the dependencies label 2026-03-13 10:21:29 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Feb 2, 2026):

To remove the automatic installation of better-sqlite3 during your Docker build process, you could consider marking the dependency as an optional peer dependency. This approach ensures that better-sqlite3 is only installed if your project explicitly requires it. In Better Auth, it's possible to define optional dependencies, which might achieve the desired effect of not slowing down your build process if you’re not using SQLite3.

You might want to explore configuring your project's package.json file by adding better-sqlite3 under peerDependencies and specifying it as optional. This way, it wouldn’t install unless needed, allowing you to avoid the Python compilation requirements.

If you have additional specific configurations in mind or if you face challenges implementing this, feel free to ask further. Have you tried modifying your package.json for other optional dependencies before?

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

DiagramDiscordGitHub

Diagram Join Star

@better-auth-agent[bot] commented on GitHub (Feb 2, 2026): To remove the automatic installation of `better-sqlite3` during your Docker build process, you could consider marking the dependency as an optional peer dependency. This approach ensures that `better-sqlite3` is only installed if your project explicitly requires it. In Better Auth, it's possible to define optional dependencies, which might achieve the desired effect of not slowing down your build process if you’re not using SQLite3. You might want to explore configuring your project's `package.json` file by adding `better-sqlite3` under `peerDependencies` and specifying it as optional. This way, it wouldn’t install unless needed, allowing you to avoid the Python compilation requirements. If you have additional specific configurations in mind or if you face challenges implementing this, feel free to ask further. Have you tried modifying your `package.json` for other optional dependencies before? _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/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Author
Owner

@bytaesu commented on GitHub (Feb 2, 2026):

Hi @heshine0,

Could you share the results of this command? 🧐

# npm
npm explain better-sqlite3

# pnpm
pnpm why better-sqlite3

# bun
bun why better-sqlite3

# yarn
yarn why better-sqlite3
@bytaesu commented on GitHub (Feb 2, 2026): Hi @heshine0, Could you share the results of this command? 🧐 ```sh # npm npm explain better-sqlite3 # pnpm pnpm why better-sqlite3 # bun bun why better-sqlite3 # yarn yarn why better-sqlite3 ```
Author
Owner

@heshine0 commented on GitHub (Feb 3, 2026):

@bytaesu the result of lf bun why better-sqlite3 were appended, Please review it.

Is this suited for github?

  • Yes, this is suited for github

It's about a docker build project where installing better-sqlite3 is particularly slow because it also requires a Python compilation environment. How can I remove the automatic installation of this better-sqlite3 since I'm not using sqlite3?

Describe the solution you'd like

Remove the automatic installation of this better-sqlite3 when the project doesn't use it.

Describe alternatives you've considered

Remove the automatic installation of this better-sqlite3 when the project doesn't use it.

Additional context

****@Shine:~/projects/sso-auth$ bun why better-sqlite3
[0.12ms] ".env"
better-sqlite3@12.6.2
├─ @better-auth/cli@1.4.18 (requires ^12.2.0)
│ └─ dev sso-auth (requires ^1.4.18)
├─ optional peer better-auth@1.4.18 (requires ^12.0.0)
│ ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18)
│ │ └─ sso-auth (requires ^1.4.18)
│ ├─ @better-auth/cli@1.4.18 (requires ^1.4.18)
│ │ └─ dev sso-auth (requires ^1.4.18)
│ └─ sso-auth (requires ^1.4.18)

├─ optional peer drizzle-orm@0.41.0 (requires >=7)
│ ├─ @better-auth/cli@1.4.18 (requires ^0.41.0)
│ │ └─ dev sso-auth (requires ^1.4.18)
│ └─ optional peer better-auth@1.4.18 (requires >=0.41.0)
│ ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18)
│ │ └─ sso-auth (requires ^1.4.18)
│ ├─ @better-auth/cli@1.4.18 (requires ^1.4.18)
│ │ └─ dev sso-auth (requires ^1.4.18)
│ └─ sso-auth (requires ^1.4.18)

└─ optional peer prisma@7.3.0 (requires >=9.0.0)
├─ optional peer better-auth@1.4.18 (requires ^5.0.0 || ^6.0.0 || ^7.0.0)
│ ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18)
│ │ └─ sso-auth (requires ^1.4.18)
│ ├─ @better-auth/cli@1.4.18 (requires ^1.4.18)
│ │ └─ dev sso-auth (requires ^1.4.18)
│ └─ sso-auth (requires ^1.4.18)
├─ dev sso-auth (requires ^7.3.0)
├─ optional peer @prisma/client@7.3.0 (requires *)
│ ├─ sso-auth (requires ^7.3.0)
│ ├─ optional peer better-auth@1.4.18 (requires ^5.0.0 || ^6.0.0 || ^7.0.0)
│ │ ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18)
│ │ │ └─ sso-auth (requires ^1.4.18)
│ │ ├─ @better-auth/cli@1.4.18 (requires ^1.4.18)
│ │ │ └─ dev sso-auth (requires ^1.4.18)
│ │ └─ sso-auth (requires ^1.4.18)
│ └─ optional peer drizzle-orm@0.41.0 (requires *)
│ ├─ @better-auth/cli@1.4.18 (requires ^0.41.0)
│ │ └─ dev sso-auth (requires ^1.4.18)
│ └─ optional peer better-auth@1.4.18 (requires >=0.41.0)
│ ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18)
│ │ └─ sso-auth (requires ^1.4.18)
│ ├─ @better-auth/cli@1.4.18 (requires ^1.4.18)
│ │ └─ dev sso-auth (requires ^1.4.18)
│ └─ sso-auth (requires ^1.4.18)
└─ optional peer @prisma/client@5.22.0 (requires *)
└─ @better-auth/cli@1.4.18 (requires ^5.22.0)
└─ dev sso-auth (requires ^1.4.18)
No response

@heshine0 commented on GitHub (Feb 3, 2026): @bytaesu the result of lf `bun why better-sqlite3` were appended, Please review it. > ### Is this suited for github? > * [ ] Yes, this is suited for github > > ### Is your feature request related to a problem? Please describe. > It's about a docker build project where installing better-sqlite3 is particularly slow because it also requires a Python compilation environment. How can I remove the automatic installation of this better-sqlite3 since I'm not using sqlite3? > > ### Describe the solution you'd like > Remove the automatic installation of this better-sqlite3 when the project doesn't use it. > > ### Describe alternatives you've considered > Remove the automatic installation of this better-sqlite3 when the project doesn't use it. > > ### Additional context > ****@Shine:~/projects/sso-auth$ bun why better-sqlite3 > [0.12ms] ".env" > better-sqlite3@12.6.2 > ├─ @better-auth/cli@1.4.18 (requires ^12.2.0) > │ └─ dev sso-auth (requires ^1.4.18) > ├─ optional peer better-auth@1.4.18 (requires ^12.0.0) > │ ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18) > │ │ └─ sso-auth (requires ^1.4.18) > │ ├─ @better-auth/cli@1.4.18 (requires ^1.4.18) > │ │ └─ dev sso-auth (requires ^1.4.18) > │ └─ sso-auth (requires ^1.4.18) > │ > ├─ optional peer drizzle-orm@0.41.0 (requires >=7) > │ ├─ @better-auth/cli@1.4.18 (requires ^0.41.0) > │ │ └─ dev sso-auth (requires ^1.4.18) > │ └─ optional peer better-auth@1.4.18 (requires >=0.41.0) > │ ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18) > │ │ └─ sso-auth (requires ^1.4.18) > │ ├─ @better-auth/cli@1.4.18 (requires ^1.4.18) > │ │ └─ dev sso-auth (requires ^1.4.18) > │ └─ sso-auth (requires ^1.4.18) > │ > └─ optional peer prisma@7.3.0 (requires >=9.0.0) > ├─ optional peer better-auth@1.4.18 (requires ^5.0.0 || ^6.0.0 || ^7.0.0) > │ ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18) > │ │ └─ sso-auth (requires ^1.4.18) > │ ├─ @better-auth/cli@1.4.18 (requires ^1.4.18) > │ │ └─ dev sso-auth (requires ^1.4.18) > │ └─ sso-auth (requires ^1.4.18) > ├─ dev sso-auth (requires ^7.3.0) > ├─ optional peer @prisma/client@7.3.0 (requires *) > │ ├─ sso-auth (requires ^7.3.0) > │ ├─ optional peer better-auth@1.4.18 (requires ^5.0.0 || ^6.0.0 || ^7.0.0) > │ │ ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18) > │ │ │ └─ sso-auth (requires ^1.4.18) > │ │ ├─ @better-auth/cli@1.4.18 (requires ^1.4.18) > │ │ │ └─ dev sso-auth (requires ^1.4.18) > │ │ └─ sso-auth (requires ^1.4.18) > │ └─ optional peer drizzle-orm@0.41.0 (requires *) > │ ├─ @better-auth/cli@1.4.18 (requires ^0.41.0) > │ │ └─ dev sso-auth (requires ^1.4.18) > │ └─ optional peer better-auth@1.4.18 (requires >=0.41.0) > │ ├─ peer @better-auth/oauth-provider@1.4.18 (requires 1.4.18) > │ │ └─ sso-auth (requires ^1.4.18) > │ ├─ @better-auth/cli@1.4.18 (requires ^1.4.18) > │ │ └─ dev sso-auth (requires ^1.4.18) > │ └─ sso-auth (requires ^1.4.18) > └─ optional peer @prisma/client@5.22.0 (requires *) > └─ @better-auth/cli@1.4.18 (requires ^5.22.0) > └─ dev sso-auth (requires ^1.4.18) > _No response_
Author
Owner

@bytaesu commented on GitHub (Feb 3, 2026):

Hi @heshine0,

I opened a related PR, but this isn't the root issue.

Even though you're using CLI as a dev dependency, it's included in your Docker. You’ll likely need to update your production Dockerfile.

@bytaesu commented on GitHub (Feb 3, 2026): Hi @heshine0, I opened a related PR, but this isn't the root issue. Even though you're using CLI as a dev dependency, it's included in your Docker. You’ll likely need to update your production Dockerfile.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#2808