better-sqlite3 icon indicating copy to clipboard operation
better-sqlite3 copied to clipboard

Install better-sqlite3 with Termux.

Open Cyriaque-TONNERRE opened this issue 2 years ago • 1 comments

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

Cyriaque-TONNERRE avatar Aug 02 '22 09:08 Cyriaque-TONNERRE

Is this the entire log? I think the actual error is missing.

Try deleting node_modules + package-lock.json and install again

Prinzhorn avatar Aug 02 '22 12:08 Prinzhorn

  1. Install Termux on the Google Play store
  2. Run Termux, run pkg upgrade and install nodejs (this would include npm), python, make, clang(pkg install nodejs python make clang binutils)
  3. mkdir test && cd test && npm init -y
  4. Install better-sqlite3: npm i better-sqlite3

lyswhut avatar Jan 04 '23 04:01 lyswhut

I have followed the steps above to successfully install and work:

Screenshot_2023-01-04-13-09-19-765-edit_com termux

lyswhut avatar Jan 04 '23 05:01 lyswhut

it worked and it took 10mins to compile in my case xD

n-ce avatar Aug 10 '23 13:08 n-ce