content icon indicating copy to clipboard operation
content copied to clipboard

Error when install the better-sqlite3

Open prpanto opened this issue 3 months ago • 2 comments

I install the content and it ask me for the better-sqlite3. It try to install the better-sqlite3 but the next error appear...

>npm install better-sqlite3 
The system cannot find the drive specified.
npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     '[project_path]\\node_modules\\tar-fs',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir '[project_path]\node_modules\tar-fs\test\fixtures\b\a'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: '[project_path]\\node_modules\\tar-fs\\test\\fixtures\\b\\a'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     '[project_path]\\node_modules\\bl',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir '[project_path]\node_modules\bl\node_modules\readable-stream'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: '[project_path]\\node_modules\\bl\\node_modules\\readable-stream'
npm warn cleanup     }
npm warn cleanup   ]
npm warn cleanup ]
npm error code 1
npm error path [project_path]\node_modules\better-sqlite3
npm error command failed
npm error command powershell -c prebuild-install || node-gyp rebuild --release
npm error At line:1 char:18
npm error + prebuild-install || node-gyp rebuild --release
npm error +                  ~~
npm error The token '||' is not a valid statement separator in this version.
npm error     + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
npm error     + FullyQualifiedErrorId : InvalidEndOfLine
npm error A complete log of this run can be found in: C:\Users\[user]AppData\Local\npm-cache\_logs\2025-10-09T18_35_06_145Z-debug-0.log

prpanto avatar Oct 09 '25 18:10 prpanto

  • Were you running the dev command while installing? Try installing the better-sqlite3 dependency without running the dev server.
  • You can also try manually removing your node_modules folder and then running the install command again.

If neither of these solutions works, please provide more details for reproduction, such as your npm version, operating system, and other environment information.

hope that may help you.😊

Alaye-Dong avatar Oct 16 '25 05:10 Alaye-Dong

Unfortunately I'm not experiences in windows and I don't have a solution for this. This is not related to module, but how node is configured in your system and how it tries to install native bundle of better-sqlite3

If you are using node v22.5.0+, try enabling native connector to use node's native sqlite adapter. With Node's native adapter you don't need better-sqlite3 package anymore.

Checkout: https://content.nuxt.com/docs/getting-started/configuration#experimentalsqliteconnector

farnabaz avatar Oct 27 '25 14:10 farnabaz