Skip to content

[BUG]:pnpm dlx drizzle-kit generate fails with "Please install latest version of drizzle-orm" despite having latest version #4981

@AbdulMuspik

Description

@AbdulMuspik

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

0.44.6

What version of drizzle-kit are you using?

0.31.5

Other packages

drizzle-zod@0.8.3

Describe the Bug

Bug Description

When running pnpm dlx drizzle-kit generate, the command fails with the error "Please install latest version of drizzle-orm" even though the latest versions of both drizzle-orm and drizzle-kit are installed. The same command works perfectly when using npx drizzle-kit generate.

Environment

Package Manager: pnpm v10.4.1
drizzle-orm: 0.44.6 (latest)
drizzle-kit: 0.31.5 (latest)
Node.js: v22.20.0
OS: macOS (darwin)

Steps to Reproduce

Install latest versions of drizzle-orm and drizzle-kit with pnpm
Create a valid drizzle.config.ts file
Run pnpm dlx drizzle-kit generate
Observe the error message

Expected Behavior

The command should generate migrations successfully, just like it does with npx.

Actual Behavior

No config path provided, using default 'drizzle.config.ts'
Reading config file '/path/to/drizzle.config.ts'
Please install latest version of drizzle-orm

Workaround

Using npx drizzle-kit generate instead of pnpm dlx drizzle-kit generate works perfectly and generates the expected migration files.

Additional Context

pnpm list drizzle-orm drizzle-kit confirms both packages are at their latest versions
The drizzle.config.ts file is valid (works with npx)
This appears to be a compatibility issue between pnpm's dlx command and drizzle-kit's version detection logic

Configuration

// drizzle.config.ts
import "dotenv/config";
import { defineConfig } from "drizzle-kit";

export default defineConfig({
out: "./drizzle",
schema: "./src/auth-db/schema.ts",
dialect: "postgresql",
dbCredentials: {
url: process.env.AUTH_DATABASE_URL as string,
},
});

This issue affects developer experience when using pnpm as the primary package manager, forcing users to switch to npx for drizzle-kit commands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions