You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@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!
I am getting an error while connecting to sqlite3 database.
This is my code
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
The text was updated successfully, but these errors were encountered: