node.jsnpmraspberry-pidiscord.jsbetter-sqlite3

Can't get Better-Sqlite3 installed on my Raspberry PI


I'm currently trying to run my Discord Bot on my Raspberry PI but I can't install Better-Sqlite3 on it. I don't really know what to do with all those errors or what they are telling me so I hope someone in here can help me with my problem. If you need any other information just let me know.


> better-sqlite3@7.1.2 install /home/pi/Discord Bot/node_modules/better-sqlite3
> prebuild-install || npm run build-release

prebuild-install WARN install No prebuilt binaries found (target=10.23.1 runtime=node arch=arm libc= platform=linux)

> better-sqlite3@7.1.2 build-release /home/pi/Discord Bot/node_modules/better-sqlite3
> node-gyp rebuild --release

make: Entering directory '/home/pi/Discord Bot/node_modules/better-sqlite3/build'
  TOUCH b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
  ACTION deps_sqlite3_gyp_locate_sqlite3_target_extract_sqlite3 b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
/bin/sh: 1: Bot/node_modules/better-sqlite3/build/Release/lib.host:/home/pi/Discord: not found
/home/pi/Discord Bot/node_modules/better-sqlite3/deps/extract.js:8
process.on('unhandledRejection', (err) => { throw err; });
                                            ^

CwdError: ENOENT: Cannot cd into '/home/pi/Discord Bot/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3'
    at fs.stat (/home/pi/Discord Bot/node_modules/tar/lib/mkdir.js:74:14)
    at FSReqWrap.oncomplete (fs.js:153:21)
make: *** [deps/locate_sqlite3.target.mk:17: b857c92884e9598d609f6be182a2595df7a8e00f.intermediate] Error 1
rm b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
make: Leaving directory '/home/pi/Discord Bot/node_modules/better-sqlite3/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:191:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 5.4.51-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /home/pi/Discord Bot/node_modules/better-sqlite3
gyp ERR! node -v v10.23.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3@7.1.2 build-release: `node-gyp rebuild --release`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the better-sqlite3@7.1.2 build-release script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2021-01-23T13_30_26_759Z-debug.log
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/Discord Bot/package.json'
npm WARN Discord Bot No description
npm WARN Discord Bot No repository field.
npm WARN Discord Bot No README data
npm WARN Discord Bot No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3@7.1.2 install: `prebuild-install || npm run build-release`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the better-sqlite3@7.1.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2021-01-23T13_30_27_548Z-debug.log

npm start errors:

pi@raspberrypi:~/Discord Bot $ npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/pi/Discord Bot/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/pi/Discord Bot/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2021-01-23T17_14_30_893Z-debug.log

Solution

  • Ok I found the solution to my problem. I had a "space" in the folder name of the bot that's why the programm to install better-sqlite3 couldn't find the folder and it crashed. I just removed the space and it worked completly fine.