ERROR Cannot start nuxt: Could not locate the bindings file. Tried:
ERROR Cannot start nuxt: Could not locate the bindings file. Tried: nuxi 16:12:40 → C:\Users\dhj\Desktop\nuxt\digitmasterai-ui\node_modules.pnpm\[email protected]\node_modules\better-sqlite3\build\better_sqlite3.node → C:\Users\dhj\Desktop\nuxt\digitmasterai-ui\node_modules.pnpm\[email protected]\node_modules\better-sqlite3\build\Debug\better_sqlite3.node → C:\Users\dhj\Desktop\nuxt\digitmasterai-ui\node_modules.pnpm\[email protected]\node_modules\better-sqlite3\build\Release\better_sqlite3.node → C:\Users\dhj\Desktop\nuxt\digitmasterai-ui\node_modules.pnpm\[email protected]\node_modules\better-sqlite3\out\Debug\better_sqlite3.node → C:\Users\dhj\Desktop\nuxt\digitmasterai-ui\node_modules.pnpm\[email protected]\node_modules\better-sqlite3\Debug\better_sqlite3.node → C:\Users\dhj\Desktop\nuxt\digitmasterai-ui\node_modules.pnpm\[email protected]\node_modules\better-sqlite3\out\Release\better_sqlite3.node → C:\Users\dhj\Desktop\nuxt\digitmasterai-ui\node_modules.pnpm\[email protected]\node_modules\better-sqlite3\Release\better_sqlite3.node → C:\Users\dhj\Desktop\nuxt\digitmasterai-ui\node_modules.pnpm\[email protected]\node_modules\better-sqlite3\build\default\better_sqlite3.node → C:\Users\dhj\Desktop\nuxt\digitmasterai-ui\node_modules.pnpm\[email protected]\node_modules\better-sqlite3\compiled\18.20.6\win32\x64\better_sqlite3.node → C:\Users\dhj\Desktop\nuxt\digitmasterai-ui\node_modules.pnpm\[email protected]\node_modules\better-sqlite3\addon-build\release\install-root\better_sqlite3.node → C:\Users\dhj\Desktop\nuxt\digitmasterai-ui\node_modules.pnpm\[email protected]\node_modules\better-sqlite3\addon-build\debug\install-root\better_sqlite3.node → C:\Users\dhj\Desktop\nuxt\digitmasterai-ui\node_modules.pnpm\[email protected]\node_modules\better-sqlite3\addon-build\default\install-root\better_sqlite3.node → C:\Users\dhj\Desktop\nuxt\digitmasterai-ui\node_modules.pnpm\[email protected]\node_modules\better-sqlite3\lib\binding\node-v108-win32-x64\better_sqlite3.node
→ node_modules\.pnpm\[email protected]\node_modules\better-sqlite3\build\better_sqlite3.node
→ node_modules\.pnpm\[email protected]\node_modules\better-sqlite3\build\Debug\better_sqlite3.node
→ node_modules\.pnpm\[email protected]\node_modules\better-sqlite3\build\Release\better_sqlite3.node
→ node_modules\.pnpm\[email protected]\node_modules\better-sqlite3\out\Debug\better_sqlite3.node
→ node_modules\.pnpm\[email protected]\node_modules\better-sqlite3\Debug\better_sqlite3.node
→ node_modules\.pnpm\[email protected]\node_modules\better-sqlite3\out\Release\better_sqlite3.node
→ node_modules\.pnpm\[email protected]\node_modules\better-sqlite3\Release\better_sqlite3.node
→ node_modules\.pnpm\[email protected]\node_modules\better-sqlite3\build\default\better_sqlite3.node
→ node_modules\.pnpm\[email protected]\node_modules\better-sqlite3\compiled\18.20.6\win32\x64\better_sqlite3.node
→ node_modules\.pnpm\[email protected]\node_modules\better-sqlite3\addon-build\release\install-root\better_sqlite3.node
→ node_modules\.pnpm\[email protected]\node_modules\better-sqlite3\addon-build\debug\install-root\better_sqlite3.node
→ node_modules\.pnpm\[email protected]\node_modules\better-sqlite3\addon-build\default\install-root\better_sqlite3.node
→ node_modules\.pnpm\[email protected]\node_modules\better-sqlite3\lib\binding\node-v108-win32-x64\better_sqlite3.node
at bindings (node_modules\.pnpm\[email protected]\node_modules\bindings\bindings.js:126:9)
at new Database (node_modules\.pnpm\[email protected]\node_modules\better-sqlite3\lib\database.js:48:64)
at getDB (/C:/Users/dhj/Desktop/nuxt/digitmasterai-ui/node_modules/.pnpm/[email protected][email protected]/node_modules/db0/connectors/better-sqlite3.mjs:19:11)
at Object.exec (/C:/Users/dhj/Desktop/nuxt/digitmasterai-ui/node_modules/.pnpm/[email protected][email protected]/node_modules/db0/connectors/better-sqlite3.mjs:27:14)
at getLocalDatabase (/C:/Users/dhj/Desktop/nuxt/digitmasterai-ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@nuxt/content/dist/module.mjs:341:12)
at async processCollectionItems (/C:/Users/dhj/Desktop/nuxt/digitmasterai-ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@nuxt/content/dist/module.mjs:2377:14)
at async /C:/Users/dhj/Desktop/nuxt/digitmasterai-ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@nuxt/content/dist/module.mjs:2353:20
at async initNuxt (/C:/Users/dhj/Desktop/nuxt/digitmasterai-ui/node_modules/.pnpm/[email protected]_@parcel+watcher_e88361ecebb4ae245a805e9e2e84bd3c/node_modules/nuxt/dist/shared/nuxt.CrJjphBv.mjs:5343:3)
at async NuxtDevServer._load (/C:/Users/dhj/Desktop/nuxt/digitmasterai-ui/node_modules/.pnpm/@[email protected][email protected]/node_modules/@nuxt/cli/dist/chunks/dev2.mjs:161:5)
at async NuxtDevServer.load (/C:/Users/dhj/Desktop/nuxt/digitmasterai-ui/node_modules/.pnpm/@[email protected][email protected]/node_modules/@nuxt/cli/dist/chunks/dev2.mjs:93:7)
请问这种情况该怎么解决?
When using pnpm as a package manager, ensure that node-gyp is installed globally. Otherwise, try npm or yarn instead.
Google translated: 使用 pnpm 作为包管理器时,请确保全局安装 node-gyp。否则,请尝试使用 npm 或yarn
I was also pwned by this, which was the first major change described in pnpm v10. Postinstall scripts for dependencies are ignored by default. You can pnpm approve-builds to run after installation. nuxt/nuxt#3104
I tried to run the pnpm rebuild and it works.
This worked as a fix for my application. pnpm approve-builds and then select better-sqlite3 from the list.
I believe you are using pnpm@10. In pnpm@10, there is a breaking/security change that prevents package scripts from being executed. Run
pnpm approve-buildsand choosebetter-sqlite3to allow the execution. (If it didn't work on first time, some times you need to run twice or remove node_modules first)
Originally posted by @farnabaz in #3249
Thanks for sharing this solution! I think this belongs in the README or at least in the docs directory (a pr would be great!)
This worked as a fix for my application.
pnpm approve-buildsand then selectbetter-sqlite3from the list.I believe you are using pnpm@10. In pnpm@10, there is a breaking/security change that prevents package scripts from being executed. Run
pnpm approve-buildsand choosebetter-sqlite3to allow the execution. (If it didn't work on first time, some times you need to run twice or remove node_modules first)
This worked as a fix for my application.
pnpm approve-buildsand then selectbetter-sqlite3from the list.I believe you are using pnpm@10. In pnpm@10, there is a breaking/security change that prevents package scripts from being executed. Run
pnpm approve-buildsand choosebetter-sqlite3to allow the execution. (If it didn't work on first time, some times you need to run twice or remove node_modules first)
Thanks a lot. That helped me
I ran pnpm approve-builds and the output told me that I had no packages to approve. I ran pnpm rebuild then ran pnpm approve-builds and was able to get a list of packages to approve. Following the advice posted by @farnabaz, I selected better-sqlite3 and that solved my problem.
If you still run into issues after doing the above you might have accidentally added the module to the ignore list. checkout the pnpm-workspace.yaml and move - better-sqlite3 from the ignoredBuiltDependencies to the onlyBuiltDependencies list
If you still run into issues after doing the above you might have accidentally added the module to the ignore list. checkout the pnpm-workspace.yaml and move
- better-sqlite3from theignoredBuiltDependenciesto theonlyBuiltDependencieslist
Bro you deserve an award
修改一下你的 .npmrc
shamefully-hoist=true
strict-peer-dependencies=false
shell-emulator=true
auto-install-peers=false
然后重新下载依赖