Betterauth CLI Fails on sqlite
https://www.better-auth.com/docs/adapters/sqlite
After following guide from docs, Cannot generate using see error messages.
SQLite | Better Auth
Integrate Better Auth with SQLite.
11 Replies
Auth.ts
Installed
better-auth
,better-sqlite3
and @types/better-sqlite3
Is there a different way to start with sqlite than following the guide, if not can the docs be looked atAnd issue with similar issues is still open since december 2024, Surely by now this issue would of been documented or fixed:
https://github.com/better-auth/better-auth/issues/892
GitHub
Using
@better-auth/cli generate
with Sqlite & Bun / Deno fails wi...Is this suited for github? Yes, this is suited for github To Reproduce Follow "Getting started" guide on docs. (using Next.js) Create config in lib/auth.ts import { betterAuth } from &quo...
@bekacru what is the proper way to initalize a sqlite betterauth project and generate using the CLI and pnpm?
@lonelyplanet Do you know if running
migrate
will work?
I often use better-sqlite3 to do testing and stuff and it works fine, but I only use migrate.for Bun you need to use a kysley dialect. Better Auth only support better-sqlite3 out of the box
Not bun.
hmm? so it's not working with
better-sqlite3
?yes
oh this has something to do with better-sqlite3 binary
jsut try to use better-sqlite alone and see if it works
I have the same issue.
Running
pnpm dlx @better-auth/cli migrate
gives the attached error.Tried better-sqlite3 versions 11.x, 10.x, 9.x and get the same error.
Also tested with node-sqlite3 with same error. I think this is a better-auth cli bug
I belive I found the solution. After installing better-sqlite3 you need to approve it to run build scripts. For me using PNPM run
pnpm approve-builds
and then select better-sqlite3. Then you can run the CLI command.