I'm trying to get my Discord.JS bot onto an AWS server, and I keep getting this error:
/home/ec2-user/EcoBot/node_modules/bindings/bindings.js:96
throw err
^
Error: Could not locate the bindings file. Tried:
โ /home/ec2-user/EcoBot/node_modules/better-sqlite3/build/better_sqlite3.node
โ /home/ec2-user/EcoBot/node_modules/better-sqlite3/build/Debug/better_sqlite3.node
โ /home/ec2-user/EcoBot/node_modules/better-sqlite3/build/Release/better_sqlite3.node
โ /home/ec2-user/EcoBot/node_modules/better-sqlite3/out/Debug/better_sqlite3.node
โ /home/ec2-user/EcoBot/node_modules/better-sqlite3/Debug/better_sqlite3.node
โ /home/ec2-user/EcoBot/node_modules/better-sqlite3/out/Release/better_sqlite3.node
โ /home/ec2-user/EcoBot/node_modules/better-sqlite3/Release/better_sqlite3.node
โ /home/ec2-user/EcoBot/node_modules/better-sqlite3/build/default/better_sqlite3.node
โ /home/ec2-user/EcoBot/node_modules/better-sqlite3/compiled/8.11.1/linux/x64/better_sqlite3.node
at bindings (/home/ec2-user/EcoBot/node_modules/bindings/bindings.js:93:9)
at Object.
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.
I've tried looking at other issues and tried reinstalling better-sqlite3, but that didn't help. I moved the files from my Mac to the server. What do I do?
Thats not a problem of the better-sqlite3. I had this problem before.
You can fix it by follow trouble shooting guides in here
Thats a problem with node-sass i dont know if it was dependecy in better-sqlite3 here.
If still the trouble shooting guides doesn`t give you any solution. You can try my step.
npm installIf still not.
It sould be working now.
No.. That didn't work. I tried both methods and still got the same result.
Do you clearly uninstall all node with its global module? What OS do you use if in Mac or GNU/Linux i highly recommend to use NVM.
Dont know if you use windows.
I uninstalled node (afaik) and reinstalled it. I'm using Amazon Linux which I believe is Fedora, but I might be wrong.
Or you can try to rebuild the node-sass since better-sqlite3 are use it for it dependency. (This library are write on C++/C)
It should be fixed soon or explained soon by the author since not just one or two person had this issue.
Hope it will be better soon.
How do I do that?
@yoshifan509 After installing better-sqlite3, could you print out the (nested) contents of your node_modules/better-sqlite3/build directory? That will help me debug your issue.
@yoshifan509 After installing
better-sqlite3, could you print out the (nested) contents of yournode_modules/better-sqlite3/builddirectory? That will help me debug your issue.
Not trying to be rude or anything, but if it took you 2 months to respond to that, after I switched to a different SQLite Node.JS package, you shouldn't ask for the printed contents of a directory :)
@yoshifan509 You are correct.
This issue has been reported by many people for a long time, and I have never been able to reproduce it. After a certain point, one starts paying less attention to the same report over and over, hoping that another member of the community (who can reproduce the error) might be able to help.
Last night I suddenly had an idea about what might be causing this issue, which is why I chimed in. But I would need to see the directory to confirm my theory. Sorry for the trouble. Or perhaps someone else could provide me with the same information.
@JoshuaWise
I managed to fix it by making sure the "build" folder doesn't get deleted when better-sqlite3 is done installing. I believe that was your theory? I noticed it wasn't there so I uninstalled, then deleted the better-sqlite3 folder and tried again, then the folder stayed and it started working fine.
@kgossiaux That wasn't my theory. I wonder why that was happening for you, and I wonder if other people's issue was caused by the same thing.
@JoshuaWise It worked for me really well, for some odd reason every time I tried to install, that folder wasn't there so I got the same issue.
This should be fixed in version 5.0.0.
This should be fixed in version 5.0.0.
Although I installed the latest version, its the same thing with the same error
[2020-11-23 21:08:55]: ERROR Uncaught Exception: Error: Could not locate the bindings file. Tried:
โ C:Userspn965Downloadsmichellenode_modulesenmapnode_modulesbetter-sqlite3buildbetter_sqlite3.node
โ C:Userspn965Downloadsmichellenode_modulesenmapnode_modulesbetter-sqlite3buildDebugbetter_sqlite3.node
โ C:Userspn965Downloadsmichellenode_modulesenmapnode_modulesbetter-sqlite3buildReleasebetter_sqlite3.node
โ C:Userspn965Downloadsmichellenode_modulesenmapnode_modulesbetter-sqlite3outDebugbetter_sqlite3.node
โ C:Userspn965Downloadsmichellenode_modulesenmapnode_modulesbetter-sqlite3Debugbetter_sqlite3.node
โ C:Userspn965Downloadsmichellenode_modulesenmapnode_modulesbetter-sqlite3outReleasebetter_sqlite3.node
โ C:Userspn965Downloadsmichellenode_modulesenmapnode_modulesbetter-sqlite3Releasebetter_sqlite3.node
โ C:Userspn965Downloadsmichellenode_modulesenmapnode_modulesbetter-sqlite3builddefaultbetter_sqlite3.node
โ C:Userspn965Downloadsmichellenode_modulesenmapnode_modulesbetter-sqlite3compiled14.15.1win32x64better_sqlite3.node
โ C:Userspn965Downloadsmichellenode_modulesenmapnode_modulesbetter-sqlite3addon-buildreleaseinstall-rootbetter_sqlite3.node
โ C:Userspn965Downloadsmichellenode_modulesenmapnode_modulesbetter-sqlite3addon-builddebuginstall-rootbetter_sqlite3.node
โ C:Userspn965Downloadsmichellenode_modulesenmapnode_modulesbetter-sqlite3addon-builddefaultinstall-rootbetter_sqlite3.node
โ C:Userspn965Downloadsmichellenode_modulesenmapnode_modulesbetter-sqlite3libbindingnode-v83-win32-x64better_sqlite3.node
at bindings (C:Userspn965Downloadsmichellenode_modulesbindingsbindings.js:126:9)
at Object.(C:Userspn965Downloadsmichellenode_modulesenmapnode_modulesbetter-sqlite3libdatabase.js:9:24)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.(C:Userspn965Downloadsmichellenode_modulesenmapnode_modulesbetter-sqlite3libindex.js:2:18)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
Got the same error. Just installed my packages (one with a dependency to better-sqlite3 v7.1.1.) using Lerna on a fresh Ubuntu 20 using Node v14 and it seems it didn't build anything:
$ ls -al packages/sql/node_modules/better-sqlite3/
total 68
drwxrwxr-x 9 parallels parallels 4096 Dec 13 01:13 .
drwxrwxr-x 97 parallels parallels 4096 Dec 13 01:18 ..
-rw-rw-r-- 1 parallels parallels 28 Oct 26 1985 .gitattributes
drwxrwxr-x 2 parallels parallels 4096 Dec 13 01:13 .github
-rw-rw-r-- 1 parallels parallels 2040 Oct 26 1985 .travis.yml
-rw-rw-r-- 1 parallels parallels 1078 Oct 26 1985 LICENSE
-rw-rw-r-- 1 parallels parallels 4792 Oct 26 1985 README.md
-rw-rw-r-- 1 parallels parallels 255 Oct 26 1985 appveyor.yml
drwxrwxr-x 3 parallels parallels 4096 Dec 13 01:13 benchmark
-rw-rw-r-- 1 parallels parallels 620 Oct 26 1985 binding.gyp
drwxrwxr-x 2 parallels parallels 4096 Dec 13 01:13 deps
drwxrwxr-x 2 parallels parallels 4096 Dec 13 01:13 docs
drwxrwxr-x 2 parallels parallels 4096 Dec 13 01:13 lib
-rw-rw-r-- 1 parallels parallels 2381 Dec 13 01:13 package.json
drwxrwxr-x 4 parallels parallels 4096 Dec 13 01:13 src
drwxrwxr-x 2 parallels parallels 4096 Dec 13 01:13 test
It might be that some dependencies (a fresh Ubuntu installation here) are missing and the build has silently failed?
After removing the package rm -rf packages/sql/node_modules/better-sqlite3 and re-installing everything using lerna bootstrap everything works. Don't know why it hasn't been installed correctly at the beginning ๐คทโโ๏ธ.
hope the developers find a solution to this
After removing the package
rm -rf packages/sql/node_modules/better-sqlite3and re-installing everything usinglerna bootstrapeverything works. Don't know why it hasn't been installed correctly at the beginning ๐คทโโ๏ธ.
@marcj You might missing node-gyp at first install
@mandaputtra I didn't install anything in Ubuntu between the first install and the second npm install.
Most helpful comment
Thats not a problem of the better-sqlite3. I had this problem before.
You can fix it by follow trouble shooting guides in here
Thats a problem with node-sass i dont know if it was dependecy in better-sqlite3 here.
If still the trouble shooting guides doesn`t give you any solution. You can try my step.
2.
npm installIf still not.
It sould be working now.