SyntaxErrorGeek
SyntaxErrorGeek
BABetter Auth
Created by lonelyplanet on 3/28/2025 in #help
Betterauth CLI Fails on sqlite
I belive I found the solution. After installing better-sqlite3 you need to approve it to run build scripts. For me using PNPM runpnpm approve-builds and then select better-sqlite3. Then you can run the CLI command.
18 replies
BABetter Auth
Created by lonelyplanet on 3/28/2025 in #help
Betterauth CLI Fails on sqlite
Also tested with node-sqlite3 with same error. I think this is a better-auth cli bug
18 replies
BABetter Auth
Created by lonelyplanet on 3/28/2025 in #help
Betterauth CLI Fails on sqlite
Tried better-sqlite3 versions 11.x, 10.x, 9.x and get the same error.
18 replies
BABetter Auth
Created by lonelyplanet on 3/28/2025 in #help
Betterauth CLI Fails on sqlite
I have the same issue.
import { betterAuth } from "better-auth";
import Database from "better-sqlite3";

export const auth = betterAuth({
database: new Database("./sqlite.db"),
emailAndPassword: {
enabled: true,
},
socialProviders: {
microsoft: {
clientId: process.env.MICROSOFT_CLIENT_ID || "",
clientSecret: process.env.MICROSOFT_CLIENT_SECRET || "",
tenantId: process.env.MICROSOFT_TENANT_ID,
disableProfilePhoto: true,
},
},
});
import { betterAuth } from "better-auth";
import Database from "better-sqlite3";

export const auth = betterAuth({
database: new Database("./sqlite.db"),
emailAndPassword: {
enabled: true,
},
socialProviders: {
microsoft: {
clientId: process.env.MICROSOFT_CLIENT_ID || "",
clientSecret: process.env.MICROSOFT_CLIENT_SECRET || "",
tenantId: process.env.MICROSOFT_TENANT_ID,
disableProfilePhoto: true,
},
},
});
Running pnpm dlx @better-auth/cli migrate gives the attached error.
18 replies