Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Error while installing Better-Sqlite3 on a Raspberry PI #547

Closed
dakornmayer opened this issue Jan 26, 2021 · 6 comments
Closed

Getting Error while installing Better-Sqlite3 on a Raspberry PI #547

dakornmayer opened this issue Jan 26, 2021 · 6 comments

Comments

@dakornmayer
Copy link

dakornmayer commented Jan 26, 2021

Hello,
I made a Discord Bot for which I used Better-Sqlite3 for. Everything worked fine on my Windows Computer and I'm now trying to get it running on a Raspberry PI but I always get the same errors.

pi@raspberrypi:~/Discord Bot $ npm i better-sqlite3

[email protected] install /home/pi/Discord Bot/node_modules/better-sqlite3
prebuild-install || npm run build-release

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

[email protected] 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 /home/pi/Discord Bot/node_modules/tar/lib/mkdir.js:74:14
at FSReqCallback.oncomplete (fs.js:168:21) {
path: '/home/pi/Discord Bot/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3',
code: 'ENOENT'
}
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:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276: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 v12.20.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build-release: node-gyp rebuild --release
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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-26T00_51_09_585Z-debug.log
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: prebuild-install || npm run build-release
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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-26T00_51_10_457Z-debug.log
`
I hope you can help me on here
Thanks

@Prinzhorn
Copy link
Contributor

This looks fun

 /bin/sh: 1: Bot/node_modules/better-sqlite3/build/Release/lib.host:/home/pi/Discord: not found

does it work if the folder doesn't contain spaces? E.g. Discord_Bot?

@dakornmayer
Copy link
Author

Ok that was the problem. I'm new to this whole Raspberry PI thing and didn't know you aren't allowed to have a space in there.

Thx Prinzhorn

@Prinzhorn
Copy link
Contributor

This might be a bug (or a limitation) in node-gyp or maybe it's fixed if you upgrade to the latest node-gyp. See https://github.com/JoshuaWise/better-sqlite3/blob/master/docs/troubleshooting.md

@TheDcoder
Copy link

@Prinzhorn I am having the same issue, the module cannot be installed in paths which have spaces. I don't think it's a limitation in node-gyp as it's a fairly trivial issue.

@JoshuaWise Can you take a look at the issue? I would try but I am not familiar with node-gyp, my best guess would be it's something wrong in the build script provided by you.

I have made a detailed report here: nodejs/help#3634

@Prinzhorn
Copy link
Contributor

I don't think it's a limitation in node-gyp as it's a fairly trivial issue.

I'm not making these things up

nodejs/node-gyp#65
nodejs/node-gyp#439

Right, this is still an issue but it's unlikely to get fixed because it's not just node-gyp that's sensitive to blanks in paths.

@TheDcoder
Copy link

Wow... that's kinda shocking, the second issue was outright closed as won't fix 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants