You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is pnpm workspace + electron + better-sqlite3 across 2 packages don't interact well:
better-sqlite3 escapes the versioning system, by having a postinstall that cares about your node version among other things
electron bundles its own node version, which can easily drift from the workspace or other package nodes
pnpm doesn't make it easy to escape its node_modules management per package
If I understand right... better-sqlite3 is following the right pattern with postinstall and it should be supported. node version mismatch between packages is unexpected because usually you want them to co-operate, but valid, and besides, workspaces are used for lots of monorepo patterns, and you might update the node version within a monorepo for different packages at different times. so that makes this a valid feature request for pnpm.
I don't know any way to tell pnpm, "even though this is the same version of better-sqlite3, duplicate it per package anyway." this means escaping pnpm's core feature, but I either escape it for one package or just stop using it entirely.
node-linker=hoisted is the opposite of what we want... although I will in fact need hoisting to make electron work
shamefullyHoist=true helps fix the electron build while using isolated linker
dependenciesMeta -> injected is something AI keeps recommending but seems to only be relevant to locally linked files and doesn't do anything
sharedWorkspaceLockfile=false is sort of related but does not do what we want
workaround: make sure you're using a consistent node version in the workspace, including electron's internal node version
workaround: don't put electron in a workspace
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
The issue is pnpm workspace + electron + better-sqlite3 across 2 packages don't interact well:
If I understand right... better-sqlite3 is following the right pattern with postinstall and it should be supported. node version mismatch between packages is unexpected because usually you want them to co-operate, but valid, and besides, workspaces are used for lots of monorepo patterns, and you might update the node version within a monorepo for different packages at different times. so that makes this a valid feature request for pnpm.
I don't know any way to tell pnpm, "even though this is the same version of better-sqlite3, duplicate it per package anyway." this means escaping pnpm's core feature, but I either escape it for one package or just stop using it entirely.
node-linker=hoisted
is the opposite of what we want... although I will in fact need hoisting to make electron workshamefullyHoist=true
helps fix the electron build while usingisolated
linkerdependenciesMeta -> injected
is something AI keeps recommending but seems to only be relevant to locally linked files and doesn't do anythingsharedWorkspaceLockfile=false
is sort of related but does not do what we wantworkaround: make sure you're using a consistent node version in the workspace, including electron's internal node version
workaround: don't put electron in a workspace
Beta Was this translation helpful? Give feedback.
All reactions