openstatusHQ / openstatus

🏓 The open-source synthetic monitoring platform 🏓
https://openstatus.dev
GNU Affero General Public License v3.0
6.46k stars 407 forks source link

better-sqlite3 fails to build on Debian 12 #1061

Open clinton-exceltelecom opened 1 month ago

clinton-exceltelecom commented 1 month ago

Reproduction / Replay Link (Optional)

No response

Description

When running 'pnpm install' the following error occurs:

node_modules/.pnpm/better-sqlite3@11.4.0/node_modules/better-sqlite3: Running install script, failed in 5.5s
.../node_modules/better-sqlite3 install$ prebuild-install || node-gyp rebuild --release
│ prebuild-install warn install Request timed out
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@10.2.0
│ gyp info using node@20.18.0 | linux | x64
│ gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3"
│ gyp info spawn /usr/bin/python3
│ gyp info spawn args [
│ gyp info spawn args '/root/.local/share/pnpm/global/5/.pnpm/node-gyp@10.2.0/node_modules/node-gyp/gyp/gyp_main.py',
│ gyp info spawn args 'binding.gyp',
│ gyp info spawn args '-f',
│ gyp info spawn args 'make',
│ gyp info spawn args '-I',
│ gyp info spawn args '/root/openstatus/node_modules/.pnpm/better-sqlite3@11.4.0/node_modules/better-sqlite3/build/config.gypi',
│ gyp info spawn args '-I',
│ gyp info spawn args '/root/.local/share/pnpm/global/5/.pnpm/node-gyp@10.2.0/node_modules/node-gyp/addon.gypi',
│ gyp info spawn args '-I',
│ gyp info spawn args '/root/.cache/node-gyp/20.18.0/include/node/common.gypi',
│ gyp info spawn args '-Dlibrary=shared_library',
│ gyp info spawn args '-Dvisibility=default',
│ gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/20.18.0',
│ gyp info spawn args '-Dnode_gyp_dir=/root/.local/share/pnpm/global/5/.pnpm/node-gyp@10.2.0/node_modules/node-gyp',
│ gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/20.18.0/<(target_arch)/node.lib',
│ gyp info spawn args '-Dmodule_root_dir=/root/openstatus/node_modules/.pnpm/better-sqlite3@11.4.0/node_modules/better-sqlite3',
│ gyp info spawn args '-Dnode_engine=v8',
│ gyp info spawn args '--depth=.',
│ gyp info spawn args '--no-parallel',
│ gyp info spawn args '--generator-output',
│ gyp info spawn args 'build',
│ gyp info spawn args '-Goutput_dir=.'
│ gyp info spawn args ]
│ gyp info spawn make
│ gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
│ make: Entering directory '/root/openstatus/node_modules/.pnpm/better-sqlite3@11.4.0/node_modules/better-sqlite3/build'
│   TOUCH ba23eeee118cd63e16015df367567cb043fed872.intermediate
│   ACTION deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 ba23eeee118cd63e16015df367567cb043fed872.intermediate
│   TOUCH Release/obj.target/deps/locate_sqlite3.stamp
│   CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
│ make: cc: No such file or directory
│ make: *** [deps/sqlite3.target.mk:198: Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o] Error 127
│ rm ba23eeee118cd63e16015df367567cb043fed872.intermediate
│ make: Leaving directory '/root/openstatus/node_modules/.pnpm/better-sqlite3@11.4.0/node_modules/better-sqlite3/build'
│ gyp ERR! build error 
│ gyp ERR! stack Error: `make` failed with exit code: 2
│ gyp ERR! stack at ChildProcess.<anonymous> (/root/.local/share/pnpm/global/5/.pnpm/node-gyp@10.2.0/node_modules/node-gyp/lib/build.js:216:23)
│ gyp ERR! System Linux 6.8.12-1-pve
│ gyp ERR! command "/root/.nvm/versions/node/v20.18.0/bin/node" "/root/.local/share/pnpm/global/5/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
│ gyp ERR! cwd /root/openstatus/node_modules/.pnpm/better-sqlite3@11.4.0/node_modules/better-sqlite3
│ gyp ERR! node -v v20.18.0
│ gyp ERR! node-gyp -v v10.2.0
│ gyp ERR! not ok 
└─ Failed in 5.5s at /root/openstatus/node_modules/.pnpm/better-sqlite3@11.4.0/node_modules/better-sqlite3
 ELIFECYCLE  Command failed with exit code 1.
 

Environment

System:
    OS: Linux 6.8 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (2) x64 Intel(R) Xeon(R) CPU E3-1225 v3 @ 3.20GHz
    Memory: 1.67 GB / 2.00 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node
    npm: 10.9.0 - ~/.nvm/versions/node/v20.18.0/bin/npm
    pnpm: 9.12.2 - ~/.local/share/pnpm/pnpm
  npmPackages:
    @biomejs/biome: 1.8.3 => 1.8.3 
    @turbo/gen: 1.13.3 => 1.13.3 
    @types/node: 20.8.0 => 20.8.0 
    knip: 5.16.0 => 5.16.0 
    turbo: 1.13.3 => 1.13.3 
    typescript: 5.5.2 => 5.5.2
skdishansachin commented 2 weeks ago

Your issue seems to be related to the issue here. The better-sqlite3 team stated it was fixed in version v6.0.1. But if you're interested, you can check the issue for additional solutions that others found helpful.