Node-sqlite3: Module node_sqlite3.node not found in node-v47-linux-x64 but npm installs v46

Created on 10 Aug 2016  路  5Comments  路  Source: mapbox/node-sqlite3

I'm trying to use the sqlite3 module, and in the past it has worked fine, but recently when I try to start my app it throws an error:

Error: Cannot find module '/app/node_modules/sqlite3/lib/binding/node-v47-linux-x64/node_sqlite3.node'

I've checked /lib/binding/ and there's a directory node-v46-linux-x64 but not a v47 one. I've tried both the regular install and --build-from-source but both give me the v46 directory, and the module itself keeps looking for v47.

Is this a bug, or am I installing the module wrong? I've tried removing the module and re-installing it multiple times, but no changes. The install itself works just fine, but then when I start my Node app the error appears and the app crashes. Please help me or advise how to fix this error.

I'm using version 3.1.4 of node-sqlite, running on node 4.4.7 (currently the latest LTS release).

Most helpful comment

Ok, I could fix it, @woubuc, @jaypozo, @spaceguy101. Try just to remove the package inside the node_modules folder (or remove the entire folder) and then execute npm install in the Terminal in the main project folder.

All 5 comments

I'm having this same problem, problem also exists at version 3.1.3, node 4.2.7

I'm facing this same issue on 3.1.4 . Any solutions?

Same problem here with node 5.7.1 and npm 3.6.0. Thanks for any advice!

Ok, I could fix it, @woubuc, @jaypozo, @spaceguy101. Try just to remove the package inside the node_modules folder (or remove the entire folder) and then execute npm install in the Terminal in the main project folder.

The bug still present on the last production version of the package. But I think it had to be present on some node versions, because in many cases the installer works without any error. I tested it on the version 10.0.0 and the lastest of the 8.x and gives me errors even using the flag --build-from-source

Was this page helpful?
0 / 5 - 0 ratings