Next.js Discord

Discord Forum

drizzle orm build failing

Unanswered
American Wirehair posted this in #help-forum
Open in Discord
American WirehairOP
hey guys, I am trying to deploy my app using drizzle, but I'll get better-sqlite3 install: gyp ERR! stack Error: Could not find any Python installation to use. how to fix this?

29 Replies

@Anay-208 | Ping in replies umm what programming language are you using?
American WirehairOP
typescript
thats why I am wondering
here's the whole error again:
https://just-paste.it/0412t8Yk4p
@Anay-208 | Ping in replies umm why does it say python here?
American WirehairOP
as you can read, because node-gyp needs python.
but I don't even need that
American WirehairOP
I am not using this by myself. it comes from drizzle. i am using postgres
oh you are using sqlite with drizzle, right?
American WirehairOP
no no, i am using postgresql with drizzle
can you send code of file where you're exporting db?
and can you send your package.json?
American WirehairOP
sure thats the package.json from my database package:
{
  "name": "@test/database",
  "version": "0.0.0",
  "type": "module",
  "private": true,
  "exports": {
    ".": "./src/index.ts"
  },
  "scripts": {
    "db:check": "drizzle-kit check",
    "db:generate": "drizzle-kit generate",
    "db:push": "drizzle-kit push"
  },
  "dependencies": {
    "dotenv": "^16.4.7",
    "drizzle-orm": "^0.41.0",
    "pg": "^8.13.1",
    "postgres": "^3.4.5"
  },
  "devDependencies": {
    "@types/pg": "^8.11.10",
    "tsx": "^4.19.2"
  }
}


and thats my database.ts:
import * as dotenv from "dotenv";
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";
import * as schema from "./schema.ts";

dotenv.config({ path: "../../.env" });

console.log(process.env.DATABASE_URL);

const connectionString = process.env.DATABASE_URL || "";
const client = postgres(connectionString);

export const db = drizzle(client, { schema });
can you try deleting node_modules and try again?
@Anay-208 | Ping in replies can you try deleting `node_modules` and try again?
American WirehairOP
did that already, deleted node_modules and pnpm-lock, ran pnpm i again and then the same error apeared
are you using a monorepo?
American WirehairOP
yes
have you setup pnpm-workspace.yaml?
American WirehairOP
yes:

packages:
  - "apps/*"
  - "packages/*"


thats the weird thing, before everything worked. after nothing it fails now
does any of your app in apps folder has better-sqlite3 package?
@Anay-208 | Ping in replies does any of your app in `apps` folder has `better-sqlite3` package?
American WirehairOP
no, none of them. in the pnpm-lock, its only as a dependency in drizzle-orm.
ah, and in better-auth apparently
can you create a minimum reproduction repo?
The thing I'm confused is that why would there be better-sqlite-3 if you're not even using it
American WirehairOP
would it be fine, if I add you to our current repo? would be hard to filter things out now
wait
are you using node-gyp, forgot to ask that
American WirehairOP
no
You can add my username @anay-208 to your current repo, but if its hard for me to set it up, I will need a minimum repo repo only