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

Cannot find module 'E:\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node' #1427

Closed
Thalinda opened this issue Jan 16, 2021 · 4 comments

Comments

@Thalinda
Copy link

I am developing an electron application using the sqlite3 module and I have developed the code related to function separately now after everything is done now I am trying to import that separately developed module to my main.js file but it's throwing an error from require

Cannot find module 'E:\CSV-CONVERTOR\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node'

now I have tried so many solutions I'm attaching the solution I have tried below

  1. This one
  2. This one
  3. This one
  4. This one

Error: Cannot find module 'E:\On Going Projects\CSV-CONVERTOR\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node'

Require stack:

  • E:\On Going Projects\CSV-CONVERTOR\node_modules\sqlite3\lib\sqlite3-binding.js
  • E:\On Going Projects\CSV-CONVERTOR\node_modules\sqlite3\lib\sqlite3.js
  • E:\On Going Projects\CSV-CONVERTOR\assets\processors\proccess.js
  • E:\On Going Projects\CSV-CONVERTOR\main.js
  • E:\On Going Projects\CSV-CONVERTOR\node_modules\electron\dist\resources\default_app.asar\main.js
  • at Module._resolveFilename (internal/modules/cjs/loader.js:972:15)
    at Function.n._resolveFilename (electron/js2c/browser_init.js:249:921)
    at Module._load (internal/modules/cjs/loader.js:848:27)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12738)
    at Module.require (internal/modules/cjs/loader.js:1032:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object. (E:\On Going Projects\CSV-CONVERTOR\node_modules\sqlite3\lib\sqlite3-binding.js:4:15)
    at Module._compile (internal/modules/cjs/loader.js:1152:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10)
    at Module.load (internal/modules/cjs/loader.js:992:32)

var sqlite3 = require('sqlite3').verbose();

this is the import of the sqlite package witch working perfectly when i run
node process.js
sc

@endlesstravel
Copy link

same question , but on nw.js v0.50.3

@Thalinda
Copy link
Author

Thalinda commented Jan 23, 2021

I was able to fix it after downgrading try downgrading.. and it's not affecting in mac os this happens only in windows

@endlesstravel
Copy link

after some work, i success build it and run require("sqlite3") at nw-v0.50.3
image
here is my build version :
napi-v6-win32-x64.zip

  1. use python 2.7 but not python 3.6, change path on window PATH system environment varible
  2. force to install nw-gyp and node-pre-gyp
npm i -g nw-gyp node-pre-gyp
  1. run
    npm i sqlite3 --build-from-source --runtime=node-webkit --target_arch=x64 --target=0.50.3
    or
    npm i sqlite3 --build-from-source --runtime=node-webkit --target_arch=x64 --target=nw-v0.50.3
  2. i build success in `node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node'

it need python 2.7 + nw-gyp + node-pre-gyp + visual studio 2015/2017/2019 + "visual studio c++ dev tool"
look at here : nwjs/nw-gyp#130 (comment)

@Thalinda
Copy link
Author

Thalinda commented Feb 4, 2021

now the answer of the @endlesstravel did indeed help but I had to do this also so if after doing @endlesstravel thing didn't solve do this also

@Thalinda Thalinda closed this as completed Feb 4, 2021
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