better-sqlite3
better-sqlite3 copied to clipboard
Install better-sqlite3 with Termux.
I have all tried, install gyp globale, i have the last version of nodejs, install all packages i can, add all perms to termux, and always the same problems :
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (node:events:537:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 4.19.157-perf-g17ea5704da62
gyp ERR! command "/data/data/com.termux/files/usr/bin/node" "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /data/data/com.termux/files/home/Chanael-V2/node_modules/better-sqlite3
gyp ERR! node -v v18.4.0
gyp ERR! node-gyp -v v9.0.0
gyp ERR! not ok
npm ERR! code 1
npm ERR! path /data/data/com.termux/files/home/Chanael-V2/node_modules/better-sqlite3
npm ERR! command failed
npm ERR! command sh -c prebuild-install || npm run build-release
npm ERR! A complete log of this run can be found in:
npm ERR! /data/data/com.termux/files/home/.npm/_logs/2022-08-02T09_40_37_526Z-debug-0.log
Is this the entire log? I think the actual error is missing.
Try deleting node_modules
+ package-lock.json
and install again
- Install Termux on the Google Play store
- Run Termux, run
pkg upgrade
and install nodejs (this would include npm), python, make, clang(pkg install nodejs python make clang binutils
) -
mkdir test && cd test && npm init -y
- Install better-sqlite3:
npm i better-sqlite3
I have followed the steps above to successfully install and work:
it worked and it took 10mins to compile in my case xD