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 node-v44-win32-x64\node_sqlite3.node #5911

Closed
nevi-me opened this issue Oct 3, 2015 · 20 comments
Closed

Cannot find module node-v44-win32-x64\node_sqlite3.node #5911

nevi-me opened this issue Oct 3, 2015 · 20 comments

Comments

@nevi-me
Copy link

nevi-me commented Oct 3, 2015

When running Ghost I get an error about a node_sqlite3 module not found

Issue Summary

I've been getting an error on Windows 8 & 10 since Ghost@0.5.x about a node_sqlite3 module not found. I am using Ghost as middleware on Express.js. I've tried looking at solutions on the net, but it hasn't worked. I upgraded to Ghost@latest[0.7.1] to see if problem goes away, but it still persists.

Steps to Reproduce

  1. Install Ghost@0.7.1 (or earlier) on Windows 10 x64
  2. Add Ghost as an Express middleware
  3. Run Express app, and observe crash (error details below)

I have uninstalled and reinstalled Ghost, and still get the same problem. my --msvs_version to build gyp modules is 2013, which doesn't throw errors, so I'm not sure if that's the problem.

Technical details:

  • Ghost Version: 0.7.1
  • Client OS: Windows 10 x64
  • Server OS: Ubuntu 14.04 x64
  • Node Version: 0.12.4, iojs 2.3.3
  • Browser: Chrome 47.xxx
  • Database: SQLite
Unhandled rejection Error: Cannot find module '[REDACTED]\node_modules\ghost\node_modules\sqlite3\lib\binding\node-v44-win32-x64\node_sqlite3.node'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> ([REDACTED]\node_modules\ghost\node_modules\sqlite3\lib\sqlite3.js:4:15)
    at Module._compile (module.js:430:26)
    at Object.Module._extensions..js (module.js:448:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Client_SQLite3.initDriver ([REDACTED]\node_modules\ghost\node_modules\knex\lib\dialects\sqlite3\index.js:41:24)
    at new Client_SQLite3 ([REDACTED]\node_modules\ghost\node_modules\knex\lib\dialects\sqlite3\index.js:15:10)
    at Knex.initialize ([REDACTED]\node_modules\ghost\node_modules\knex\knex.js:109:15)
    at Knex ([REDACTED]\node_modules\ghost\node_modules\knex\knex.js:13:26)
    at ConfigManager.set ([REDACTED]\node_modules\ghost\core\server\config\index.js:153:24)
    at ConfigManager.init ([REDACTED]\node_modules\ghost\core\server\config\index.js:76:10)
    at [REDACTED]\node_modules\ghost\core\server\config\index.js:267:30
    at tryCatcher ([REDACTED]\node_modules\ghost\node_modules\bluebird\js\main\util.js:24:31)
    at Promise._settlePromiseFromHandler ([REDACTED]\node_modules\ghost\node_modules\bluebird\js\main\promise.js:454:31)
    at Promise._settlePromiseAt ([REDACTED]\node_modules\ghost\node_modules\bluebird\js\main\promise.js:530:18)
    at Promise._settlePromises ([REDACTED]\node_modules\ghost\node_modules\bluebird\js\main\promise.js:646:14)
    at Async._drainQueue ([REDACTED]\node_modules\ghost\node_modules\bluebird\js\main\async.js:177:16)
    at Async._drainQueues ([REDACTED]\node_modules\ghost\node_modules\bluebird\js\main\async.js:187:10)
    at Immediate.Async.drainQueues [as _onImmediate] ([REDACTED]\node_modules\ghost\node_modules\bluebird\js\main\async.js:15:14)
    at processImmediate [as _immediateCallback] (timers.js:371:17)
@ErisDS
Copy link
Member

ErisDS commented Oct 4, 2015

Hi @nevi-mesorry to hear you're having trouble installing Ghost. This is an environment issue, where npm install is not completing successfully, which can happen for a number of reasons. If you'd like help working through debugging errors from your npm install, please head on over to slack - https://ghost.org/slack/ - and post in the #help channel. This is a bug tracker for ongoing development of the Ghost software, and we're not able to do support here!

@ErisDS ErisDS closed this as completed Oct 4, 2015
@nevi-me
Copy link
Author

nevi-me commented Oct 4, 2015

Thanks @ErisDS, I traced the error back to sqlite, and though it downloads a binary and stores it under ghost\node_modules\sqlite3\lib\binding\node-v14-win32-x64\node_sqlite3.node, a lookup to where the binary is returns ghost\node_modules\sqlite3\lib\binding\node-v44-win32-x64\node_sqlite3.node. Difference being the v14 vs. v44. Would it also help if I post a bug on mapbox/node-sqlite3?

@ErisDS
Copy link
Member

ErisDS commented Oct 6, 2015

@nevi-me That is strange, but absolutely please raise that bug on mapbox/node-sqlite3 - feel free to post a link back here but it's not something we can fix :)

@OKNoah
Copy link

OKNoah commented Nov 11, 2015

I am having the same issue with NVM version 0.10.33.

@nevi-me
Copy link
Author

nevi-me commented Nov 11, 2015

@OKNoah you have to remove the modules and rebuild from scratch. Gyp will use the version of Node that it finds, and will either build or download the appropriate binaries.

@ivangrafutko
Copy link

Not sure if this relevant to your issue. But in my package.json I added "sqlite3": "^3.1.1"
during npm install it installs sqlite3. It however does not create lib/binaries directory.
Error: Cannot find module 'C:\Users\ivan\Documents\clone\eye-of-ra\node_modules
sqlite3\lib\binding\node-v47-win32-x64\node_sqlite3.node'
Solution: delete sqlite3 folder and run npm install sqlite3.

@elliotrock
Copy link

try:

npm install sqlite3 --build-from-source

That fixed my sqlite3 install.

@vinamelody
Copy link

Hi, I still has same error after npm install sqlite3 --build-from-source using Mac os x El Capitan. Any other idea?

@ErisDS
Copy link
Member

ErisDS commented Mar 23, 2016

We have a troubleshooting guide for install issues. The most important/useful bit of which is general steps for recovering from a failure.

Most of the time if an install fails and you try again using these steps, then you will find it works because the issue is with the reliability of npm. If you get repeated failures after retrying with these steps, then likely there is another problem with your environment and you can use the relevant part of the troubleshooting guide to get ideas for how to resolve these problems.

If you need help, please use slack rather than GitHub as it's much easier to back-and-forth there than it is on GitHub.

@elliotrock
Copy link

I found the answer on stackoverflow, cannot recall right now.

On Wed, Mar 23, 2016 at 11:35 PM, Hannah Wolfe notifications@github.com
wrote:

We have a troubleshooting guide
http://support.ghost.org/troubleshooting/ for install issues. The most
important/useful bit of which is general steps for recovering from a
failure
http://support.ghost.org/troubleshooting/#fix-for-general-npm-install-errors
.

Most of the time if an install fails and you try again using these steps,
then you will find it works because the issue is with the reliability of
npm. If you get repeated failures after retrying with these steps, then
likely there is another problem with your environment and you can use the
relevant part of the troubleshooting guide to get ideas for how to resolve
these problems.

If you need help, please use slack https://ghost.org/slack rather than
github as it's much easier to back-and-forth there than it is on GitHub.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#5911 (comment)

@madhurgarg71
Copy link

madhurgarg71 commented Oct 19, 2016

Ghost supports node version 4.2.0 also. I was having this error "ERROR: Cannot find module '../../node_modules/sqlite3/lib/binding/node-v46-linux-x64/node_sqlite3.node' " .

I just installed node version 4.2.0 using nvm and installed sqlite3. The "binding" folder inside sqlite3 got a node-v47 folder instead of v46. So I just renamed the folder to v46 and downloaded the node_sqlite3.node file from here http://www.unifieddigital.com/node_modules/sqlite3/lib/binding/node-v46-linux-x64/ and replaced the file.

THIS WORKED FOR ME.!!!

@cool4zbl
Copy link

@madhurgarg71
Solved my problem!
Very thankful !

@madhurgarg71
Copy link

@cool4zbl Your welcome!

@vikaschenny
Copy link

I am having the same issue with NPM version 2.14.7 . anybody knows dat let me inform plz help

this is my error

info: Starting server
module.js:339
throw err;
^

Error: Cannot find module '/root/ffmpeg_sources/ffmpeg/mediacenterjs/node_modules/sqlite3/lib/binding/node-v46-linux-x64/node_sqlite3.node'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/root/ffmpeg_sources/ffmpeg/mediacenterjs/node_modules/sqlite3/lib/sqlite3.js:4:15)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/root/ffmpeg_sources/ffmpeg/mediacenterjs/lib/utils/database-schema.js:2:14)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)

@madhurgarg71
Copy link

@Chennaiah1990 Hey it's the same problem, just rename your directory to "node-v46-linux-x64" and inside that directory replace the "node_sqlite3.node" file with the file available here http://www.unifieddigital.com/node_modules/sqlite3/lib/binding/node-v46-linux-x64/

@paula23andrea
Copy link

Hey! I have same problem, but I need the node_sqlite3.node for Windows, does anyone have the file for windows?
I tried to replace the file, but i get Error: %1 is not a valid Win32 application.

Thanks.

@kirrg001
Copy link
Contributor

@brutus Please read here why.

@tomasdev
Copy link

tomasdev commented Aug 1, 2017

rm -Rf node_modules/sqlite3 and npm install worked for me (running an old v0.5.0 instance of ghost)

@ConnorIngold
Copy link

I'm running windows 10 and what solved it for me (after banging my head against the keyboard for 3 hours) was to first rm -Rf node_modules/sqlite3 then npm install sqlite3 --build-from-source and finally npm start I hope this saves a few hours of someone life 👍

@madhurgarg71
Copy link

Hi, I still has same error after npm install sqlite3 --build-from-source using Mac os x El Capitan. Any other idea?

Switch to the appropriate node verison using nvm and do npm rebuild

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