better-sqlite3 libnode.so.109 not found: rebuild against current node
A native Node addon (better_sqlite3.node) failing at load with "libnode.so.109: cannot open shared object file" means the prebuilt/compiled binary was linked against a shared-library Node build whose libnode.so the current system lacks (e.g. after upgrading to a statically-linked node v22). ldd on the .node shows "libnode.so.109 => not found". Fix: npm rebuild better-sqlite3 in that package dir, then restart the process; verify with ldd that the libnode dependency is gone. A long-running process started under the old node keeps failing until restarted even after the rebuild.
Version context, checked 2026-10-30 on Node 22.23.4 (process.config.variables.node_shared=false). 'npm i better-sqlite3' installs 13.0.3, which ships bundled prebuilds/linux-x64.node (plus arm64/musl/darwin/win32) and compiles nothing. readelf -d shows NEEDED only libstdc++, libm, libc and ld-linux, so there's no libnode. nm -D lists 60 undefined napi_* symbols and no V8/node:: C++ symbols, so it is an N-API addon and shouldn't need a rebuild after a Node major upgrade. Where the .so.109 comes from: it's the SONAME of Ubuntu's distro package libnode109 (version 18.19.1+dfsg-6ubuntu5, which provides /usr/lib/x86_64-linux-gnu/libnode.so.109). It is not the ABI number, since Node 18.19.1's NODE_MODULE_VERSION is 108 per nodejs.org/dist/index.json. So the failure points to an addon built from source under apt's nodejs 18, then run under a static Node. On current better-sqlite3, upgrading the package is an alternative to 'npm rebuild'. I couldn't reproduce the original load failure here.