better-sqlite3: Error: Cannot find module '../build/better_sqlite3.node'
Running on a raspberry pi 3, getting this error Tried using LZZ_COMPAT=1, no success
info using npm@6.4.1 info using node@v11.4.0
Log:
Error: Cannot find module '../build/better_sqlite3.node'
[1] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
[1] at Function.Module._load (internal/modules/cjs/loader.js:529:25)
[1] at Module.require (internal/modules/cjs/loader.js:659:17)
[1] at require (internal/modules/cjs/helpers.js:22:18)
[1] at Object.<anonymous> (/home/pi/instapy-dashboard/node_modules/better-sqlite3/lib/database.js:5:21)
[1] at Module._compile (internal/modules/cjs/loader.js:723:30)
[1] at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
[1] at Module.load (internal/modules/cjs/loader.js:620:32)
[1] at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
[1] at Function.Module._load (internal/modules/cjs/loader.js:552:3)
[1] npm ERR! code ELIFECYCLE
[1] npm ERR! errno 1
Any tips? Thanks
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 32 (3 by maintainers)
npm uninstall better-sqlite3-helper -g npm uninstall better-sqlite3-helper --save npm i better-sqlite3-helper --save it worked
Hey, it’s probably late, but if any of you are having this problem while using Glitch, you may run the following command in the console: enable-pnpm
I was able to get it running by doing
node-gyp rebuild
in both theinteger
andbetter-sqlite3
folders undernode_modules
. Hopefully this works for you!(Took a while for me to find out exactly was messing up, but I think that it’s just node-gyp being weird)
im having that too. tried all the troubleshooting stuff and whatnot. No luck
I hate the same problem…
having the same issue in 2021, solved it by running
npm rebuild
hope it helps.fixed. thanks anyways
Miky
Il Sab 11 Mag 2019, 22:19 hug0 notifications@github.com ha scritto:
For those who are using typescript, installing both
@types/better-sqlite3
andbetter-sqlite3
will solve the problem.Welp. I’m still having this issue in 2021. The latest install of Quick.db complains abt not having .node files in the builds folder
better-sqlite3
is built bynode-gyp
, which is the standard way of building any native addon for Node.js.After the binaries are built, we utilize a
node-gyp
command calledcopies
:Since this command is provided by
node-gyp
, I assume that it works on every platform. However, it seems like the issue described in this thread is likely related to thiscopies
command not working as expected.If the command is indeed supported on every platform, it’s possible that the copy is failing due to incorrect permissions or something similar.