Missing dependency on drizzle-orm in drizzle-kit?
I'm using NPM workspaces, and for some reason when I installed
drizzle-orm
it was placed in the node-modules
of that specific workspace, rather than the root. I think it was due to a conflict of the react
peer dependency (why is an ORM even depending on React?) - I have an older verison of React already installed and located in the root node_modules
.
Anyway, when I installed drizzle-kit
as a dev dependency, it installed it in the root node_modules
. Then when I run drizzle-kit generate:pg
, it fails to resolve drizzle-orm/pg-core
- probably related to the fact that that module is located in a workspace-local node_modules
, but not sure.
This is the rough structure that I ended up with after running npm install drizzle-orm --workspace my-workspace
and npm install --save-dev drizzle-kit --workspace my-workspace
:
And again, running npm exec --workspace my-workspace -- drizzle-kit generate:pg
(or through an NPM script in /workspaces/my-workspace/package.json
) results in a module resolution error:
Has anyone stumbled into this? Any suggestions on1 Reply
I did find this issue in
drizzle-kit
and it is related but doesn't directly mention NPM workspaces: https://github.com/drizzle-team/drizzle-kit-mirror/issues/52GitHub
Cannot find module "drizzle-orm/version" · Issue #52 · drizzle-team...
$ drizzle-kit generate:sqlite drizzle-kit: v0.17.6 node:internal/modules/cjs/loader:1082 const err = new Error(message); ^ Error: Cannot find module 'drizzle-orm/version' Require stack: - /...