drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
24.75k stars 656 forks source link

[BUG]: Error: The specified module could not be found. `\node_modules\@libsql\win32-x64-msvc\index.node` #3205

Open vvhybe opened 1 month ago

vvhybe commented 1 month ago

What version of drizzle-orm are you using?

^0.35.3

What version of drizzle-kit are you using?

^0.26.2

Describe the Bug

I got this error only on the Windows machine I've tried it on Linux (Ubuntu) in the WSL It works fine, except for Windows, I think because it's missing the compiled binaries from @libsql\win32-x64-msvc I tried installing it manually and adding it into production dependencies using both npm and pnpm but no chance *(i rolled out on all the boring processes deleting pkg manager cache, etc...)

{
  "dependencies": {
      "@libsql/client": "^0.14.0",
      "@libsql/win32-x64-msvc": "^0.4.6",
      "drizzle-zod": "^0.5.1",
      "drizzle-graphql": "^0.8.5",
  }
}

Here is my db file:

For database: I'm using SQLite (Turso) from 'drizzle-orm/sqlite-core';

import { drizzle } from 'drizzle-orm/libsql';
import { createClient } from '@libsql/client';
import { schema } from '@/database/schema';

export const tursoCredentials = {
  url: process.env.TURSO_DB_SCHEMA_URL!,
  authToken: process.env.TURSO_DB_SCHEMA_AUTH_TOKEN
};

const client = createClient(tursoCredentials);

export const DB = drizzle({ client, schema, casing: 'camelCase' });

Screenshot might help:

image

Expected behavior

image

Environment & setup

My Machine

My stack:

vvhybe commented 1 month ago

i dropped the same issue in the Turso libsql Github repo https://github.com/tursodatabase/libsql/issues/1797

fl0wo commented 2 weeks ago

I'm having a slightly different error as well:

drizzle-orm@0.36.1
@libsql/client@0.14.0

I'm building the library containing my drizzle client etc etc on a GitHub Action (runs-on: ubuntu-latest)

And then I'm pulling this library from npm to my NextJs app (on a MacBook M1)

Result:

image

With previous versions was working perfectly:

drizzle-orm@0.33.0
@libsql/client@0.7.0

Not sure if this can be related to this as well.