content icon indicating copy to clipboard operation
content copied to clipboard

seems to break with pnpm 10+

Open robert-hoffmann opened this issue 8 months ago • 4 comments

Environment



Version

3.5.1

Reproduction

update to latest pnpm 10.10.0 delete node_modules & package lock file run pnpm install

Image

you'll see it skipping certain builds

Description

run dev server Now we get errors around bindings

Cannot start nuxt:  Could not locate the bindings file. Tried:  
..\.pnpm\[email protected]\node_modules\better-sqlite3\build\better_sqlite3.node
...etc

pnpm approve-builds does nothing, because it was short-cuircuited by postinstall

if i remove the postinstall i can then approve the better-sqlite3 build

but pnpm approve-build, only works once ..you have to delete the whole node folder & lock file and start over otherwise ☹️

Additional context

simply using npm install, works fine

saw the problem mentioned here on PNPM https://github.com/pnpm/pnpm/issues/9045

robert-hoffmann avatar Apr 29 '25 12:04 robert-hoffmann

I ran into this, but was able to fix it. Not sure example how. Start by putting this in the pnpm-workspace.yaml to see if it fixees it:

onlyBuiltDependencies:
  - better-sqlite3

Then run pnpm rebuild better-sqlite3

marshallswain avatar Apr 30 '25 14:04 marshallswain

Thats what it added when i ran approve-build (after disabling postinstall)

However anyone that has the latest version of pnpm on their pc and initializes a new nuxt project will eventually run into this problem ...and wonder why nuxt does not work

Even more if you get/clone a full project and try to run pnpm install :: its just broken

robert-hoffmann avatar Apr 30 '25 16:04 robert-hoffmann

@farnabaz can you help us?

maximepvrt avatar May 05 '25 17:05 maximepvrt

I've received this error twice now and both times I've been able to solve the problem by running

pnpm approve-builds && pnpm rebuild

And making sure to select better-sqllite3 from the approval list.

marshallswain avatar May 14 '25 23:05 marshallswain

Node 24.4.0 Pnpm 10.13.1 Nuxt 3.17.6

I'm running into this issue. I'm on Windows 10, using Powershell. I have added onlyBuiltDependencies to both my package.json and pnpm-workspace.yaml with no success. Running pnpm approve-builds doesn't help either, especially because it doesn't list better-sqlite3 as one of the libraries needing to be built.

wishinghand avatar Jul 13 '25 20:07 wishinghand

I tried on my Linux laptop and having the same issue. I'll try a downgrade of PNPM next.

OS: POP OS 22.04 Node: 24.4.1 PNPM: 10.13.1 Nuxt: ^4.0

wishinghand avatar Jul 16 '25 17:07 wishinghand

The solution to pnpm issue should be simple as removing node_modules and lock files and run pnpm approve-builds after clean install What I suggest to try experimental native sqlite https://content.nuxt.com/docs/getting-started/configuration#experimentalnativesqlite By enabling native sqlite, module will not load better-sqlite3 and you don't need to add it to approve builds

farnabaz avatar Jul 17 '25 09:07 farnabaz

The solution to pnpm issue should be simple as removing node_modules and lock files and run pnpm approve-builds after clean install

I tried this and a few permutations without success. I did try your suggestion to use native sqlite and was able to move beyond this issue. Thanks!

wishinghand avatar Jul 18 '25 20:07 wishinghand

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Sep 16 '25 21:09 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity.

github-actions[bot] avatar Oct 16 '25 21:10 github-actions[bot]