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

Uncaught Error: Cannot find module 'path_to_project\node_modules\sqlite3\lib\binding\electron-v1.4-win32-ia32\node_sqlite3.node' #7808

Closed
jaidirectdsn opened this issue Dec 27, 2016 · 2 comments

Comments

@jaidirectdsn
Copy link

I am getting an error while connecting to sqlite3 database.
This is my code

var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database('testdb');

db.serialize(function(){

dbb.run("create table user (id int, db text)");
var stmt = db.prepare("insert into user values(?,?)");
for(var i=0; i<10; i++){

    var d = new Date();
    var n = d.toLocateTimeString();
    stmt.run(i,n);

}   
stmt.finalize();

db.each("select id, dt from user",function(err,row){
    console.log("user id:"+row.id,row.dt);
});
});
db.close();

Error is : Uncaught Error: Cannot find module 'path_to_project\node_modules\sqlite3\lib\binding\electron-v1.4-win32-ia32\node_sqlite3.node'

When i check in this folder "node_modules\sqlite3\lib\binding", it's having a folder and a file like 'node-v48-win32-ia32\node_sqlite3.node' instead of 'electron-v1.4-win32-ia32\node_sqlite3.node'.

Somebody suggested me to change the folder name 'node-v48-win32-ia32' to 'electron-v1.4-win32-ia32'. Then it will work. But it returns another error

ELECTRON_ASAR.js:173 Uncaught Error: The system cannot find message text for message number 0x%1 in the message file for %2. ?\path_to_project\node_modules\sqlite3\lib\binding\electron-v1.4-win32-ia32\node_sqlite3.node

Can anyone suggest a solution for this? I searched a lot, but no solution found for this one.

i tried both the solution below, but failed
https://gist.github.com/maximilian-ruppert/9de273f72c1ba4aa62d6
http://stackoverflow.com/questions/41307807/i-am-getting-an-error-while-connecting-to-sqlite3-database

@acburdine
Copy link
Member

@jaidirectdsn It appears that this is an issue with sqlite3 not being installed correctly on your environment. Unfortunately as it requires native dependencies, it's sometimes tricky to install on certain systems.

I'd advise trying to clear your node modules folder and npm cache then reinstalling your node modules and see if that works. (rm -rf node_modules && npm cache clear && npm install --production in your ghost directory).

Going to close this as it's not an issue with Ghost itself. If you continue to have issues please swing by our slack channel where we can provide better support. Thanks!

@jaidirectdsn
Copy link
Author

@acburdine Thanks for the reply

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

No branches or pull requests

2 participants