Node-sqlite3: Sometimes missing 'node_sqlite3.node' in install

Created on 30 May 2017  路  3Comments  路  Source: mapbox/node-sqlite3

Hey all

In the postinstall script I see this logged:

[sqlite3] Success: "/Users/alexamil/.suman/global/node_modules/sqlite3/lib/binding/node-v51-darwin-x64/node_sqlite3.node" is installed via remote

On occasion, when I try to

require('sqlite3'); 

I get this error:

 Error: Cannot find module '/Users/alexamil/.suman/global/node_modules/sqlite3/lib/binding/node-v51-darwin-x64/node_sqlite3.node'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/alexamil/.suman/global/node_modules/sqlite3/lib/sqlite3.js:4:15)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3) 

any idea why that might be so? Looks like sqlite3 is installed, but it's missing an external dep...? Maybe find a way to more reliably install 'node_sqlite3.node'? idk

Most helpful comment

I solved it by running

npm rebuild

in the containing directory. But it seems like maybe I should not have to do that? :)

All 3 comments

I solved it by running

npm rebuild

in the containing directory. But it seems like maybe I should not have to do that? :)

How did You fix it even though my code is working final .exe gives me _node_sqlite3.node_ missing error. How to include it into nexe

Same problem here, running on Windows 10 and yarn for an electron webapp. Tried the npm rebuild not working.

It's trying to open a file under lib/binding/electron-v5.0-win32-x64/node_sqlite3.node the only directory under lib/binding is node-v64-win32-x64/node_sqlite3.node.

PS, previous to this error it was giving me and errror related with the aws-sdk module:

Module not found: Error: Can't resolve 'aws-sdk'
Was this page helpful?
0 / 5 - 0 ratings

Related issues

NilSet picture NilSet  路  3Comments

pleerock picture pleerock  路  3Comments

andrewjmead picture andrewjmead  路  5Comments

gabrielfgularte picture gabrielfgularte  路  3Comments

cool-firer picture cool-firer  路  3Comments