WiseLibs / better-sqlite3

The fastest and simplest library for SQLite3 in Node.js.
MIT License
5.22k stars 390 forks source link

Error: Error relocating /nodejs/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node: _ZN2v89Exception10RangeErrorENS_5LocalINS_6StringEEE: symbol not found #1180

Closed jerrywoo96 closed 2 months ago

jerrywoo96 commented 2 months ago

image

Code that was on line 9 of the db.js file: export const db = betterSqlite3('<db file path>');

Using Node.js v22.0.0.

mceachen commented 2 months ago
  1. Never screenshot text from your terminal when posting an issue -- it's a PITA to extract text from.

  2. You didn't provide detailed OS information, so external reproduction isn't possible.

Note that Node.js v22.0.0 does not have prebuilt binaries yet, so you need to install a compiler toolchain for your system. If you're on a Debian or Ubuntu distribution, you'll need at least sudo apt install build-essential python3.

Try git cloning this tiny repository and npm install && npm test to verify your toolchain is in order:

https://github.com/mceachen/better-sqlite3-version-test

FWIW, Ubuntu 20.04 and node v22.0.0 run that project as expected