Skip to content
This repository was archived by the owner on Jul 1, 2026. It is now read-only.
This repository was archived by the owner on Jul 1, 2026. It is now read-only.

Error: Cannot find module node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node #906

Closed

Description

@Thavaprakash

Error: Cannot find module node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node

But i have node_modules/sqlite3/lib/binding/node-v48-linux-x64/node_sqlite3.node

Below the node and npm version that i'm using. Please help me to get rid of this issue
node version: v8.7.0
npm version: 5.4.2

Activity

  1. heyfgirl commented on Nov 30, 2017

    @heyfgirl

    The sqlite3 module works with Node.js v0.10.x, v0.12.x, v4.x, v5.x, v6.x and v7.x.

  2. damianobarbati commented on Dec 10, 2017

    @damianobarbati

    @mapbox-machine @hyfgirl any support for current node v9.x?

    [4/4] 📃  Building fresh packages...
    [1/9] ⠂ sqlite3: node-pre-gyp
    [2/9] ⠂ puppeteer
    [6/9] ⠂ gifsicle
    [4/9] ⠂ fsevents: node-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v59-darwin-x64.tar.gz
    error /Users/damz/Desktop/react-app/node_modules/sqlite3: Command failed.
    Exit code: 1
    Command: node-pre-gyp install --fallback-to-build
    Arguments: 
    Directory: /Users/damz/Desktop/react-app/node_modules/sqlite3
    Output:
    node-pre-gyp info it worked if it ends with ok
    node-pre-gyp info using node-pre-gyp@0.6.39
    node-pre-gyp info using node@9.2.1 | darwin | x64
    node-pre-gyp info check checked for "/Users/damz/Desktop/react-app/node_modules/sqlite3/lib/binding/node-v59-darwin-x64/node_sqlite3.node" (not found)
    node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v59-darwin-x64.tar.gz
    node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v59-darwin-x64.tar.gz
    node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v59-darwin-x64.tar.gz 
    node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@9.2.1 (node-v59 ABI, unknown) (falling back to source compile with node-gyp) 
    node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v59-darwin-x64.tar.gz 
    node-pre-gyp ERR! build error 
    node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)
    node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/damz/Desktop/react-app/node_modules/node-pre-gyp/lib/util/compile.js:77:29)
    node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:159:13)
    node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:207:12)
    node-pre-gyp ERR! stack     at onErrorNT (internal/child_process.js:389:16)
    node-pre-gyp ERR! stack     at _combinedTickCallback (internal/process/next_tick.js:138:11)
    node-pre-gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:180:9)
    node-pre-gyp ERR! System Darwin 17.2.0
    node-pre-gyp ERR! command "/usr/local/Cellar/node/9.2.1/bin/node" "/Users/damz/Desktop/react-app/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
    node-pre-gyp ERR! cwd /Users/damz/Desktop/react-app/node_modules/sqlite3
    node-pre-gyp ERR! node -v v9.2.1
    
  3. wmertens commented on Dec 26, 2017

    @wmertens
    Contributor

    Duplicate of #902

  4. chujinjin101 commented on Mar 20, 2018

    @chujinjin101

    @wmertens I also have the problem,
    Error: Cannot find module node_modules\sqlite3\lib\binding\node-v54-win32-x64\node_sqlite3.node
    but I have node_modules\sqlite3\lib\binding\node-v48-win32-x64\node_sqlite3.node
    node: v6.9.4
    npm: 3.10.10

  5. wmertens commented on Mar 20, 2018

    @wmertens
    Contributor
  6. memePushpendu commented on Jun 18, 2018

    @memePushpendu

    Where should i run "npm rebuild" ?

  7. wmertens commented on Jun 18, 2018

    @wmertens
    Contributor
  8. springmeyer commented on Jul 16, 2018

    @springmeyer
    Contributor

    Besides deleting package-lock.json the other workaround here is to upgrade to node-sqlite3@4.0.2, which should avoid this problem since it no longer uses bundledDependencies which trigger problems in recent npm versions > npm@5.6.x. refs mapbox/node-pre-gyp#403

  9. hanpari commented on Jul 30, 2018

    @hanpari
  10. arunasank commented on Nov 13, 2018

    @arunasank

    Another workaround that worked for me:
    npm uninstall sqlite3

    and then:

    npm install --save sqlite3

  11. TimDorand commented on Jan 2, 2019

    @TimDorand

    Using node v11.6.0 instead of v8.11.0 worked for me

  12. reya276 commented on Jan 18, 2019

    @reya276

    Ugh....I'm having the same issue when trying to use Knex. It says it cannot find sqlite3 but is installed.

  13. kewde commented on Jan 19, 2019

    @kewde
    Collaborator

    @reya276 re-run npm/yarn install. You've changed your version of node between installation and execution.

  14. reya276 commented on Jan 19, 2019

    @reya276
  15. 15 remaining items

  16. andrewshell commented on Dec 11, 2020

    @andrewshell

    Hopefully this fixes the issue for @nikhilpk26 and @Miltonr87

    I have:
    Ubuntu 20.04.1 LTS
    Node v14.15.1
    Npm 6.14.8

    I had to run:

    sudo apt-get install sqlite3 libsqlite3-dev
    npm rebuild

    And it worked for me.

  17. Miltonr87 commented on Dec 11, 2020

    @Miltonr87

    Thanks a lot @andrewshell , I forgot to inform here that I managed the issue with this solution and now
    everything is ok! No old versions of Node needed to be used. Thanx again!

  18. i-chaochen commented on Feb 4, 2021

    @i-chaochen

    Same issue here, but I already have that file in my node_modules folder

    Uncaught Error: Cannot find module '.../node_modules/sqlite3/lib/binding/napi-v6-darwin-x64/node_sqlite3.node'
    

    Tried many ways, (i.e., to rebuild node_sqlite3) and all failed.

    ❯ npm rebuild
    (node:24999) ExperimentalWarning: The fs.promises API is experimental
    rebuilt dependencies successfully
    

    macOS BigSur
    ❯ npm --version
    7.5.2
    ❯ node -v
    v10.15.1

  19. marcoguastalli commented on Apr 14, 2021

    @marcoguastalli

    I have the same issue with macOS BigSur:
    ❯ npm --version
    7.6.0
    ❯ node -v
    v15.1.0

    I can also reproduce it on Ubuntu 20.04.02:
    Error: Cannot find module '../node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node' Require stack: ../node_modules/sqlite3/lib/sqlite3-binding.js ../node_modules/sqlite3/lib/sqlite3.js
    ❯ npm --version
    7.7.6
    ❯ node -v
    v15.14.0

  20. miragekamran commented on Jul 26, 2021

    @miragekamran

    Using node v11.6.0 instead of v8.11.0 worked for me

  21. wmertens commented on Jul 27, 2021

    @wmertens
    Contributor

    @miragekamran Why not use the supported versions 14 or 16?

  22. MegaNoam commented on Aug 22, 2021

    @MegaNoam

    @miragekamran Why not use the supported versions 14 or 16?

    I use version 14+ and it just does not work 🤦‍♂️

  23. wmertens commented on Aug 22, 2021

    @wmertens
    Contributor

    It works for everyone else - did you try deleting node_modules and the ~/.npm cache?

  24. andyrobert3 commented on Dec 11, 2021

    @andyrobert3

    Another workaround that worked for me: npm uninstall sqlite3

    and then:

    npm install --save sqlite3

    This worked well for me, i think it just upgraded to the latest compatible version for sqlite3!

  25. akshayjain-tmdc commented on Apr 18, 2022

    @akshayjain-tmdc

    RESOLVED:
    I had a yarn.locker file in my project. I deleted that file and rebuild the project and it worked for me.
    Steps:
    1 . Delete yarn.locker
    2. docker build
    3. docker run

  26. saifookhan commented on May 11, 2022

    @saifookhan

    run npm rebuild
    …
    On Tue, Mar 20, 2018, 2:47 AM zjuchujinjin, @.***> wrote: I also have the problem, Error: Cannot find module node_modules\sqlite3\lib\binding\node-v54-win32-x64\node_sqlite3.node but I have node_modules\sqlite3\lib\binding\node-v48-win32-x64\node_sqlite3.node node: v6.9.4 npm: 3.10.10 — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#906 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AADWlqxrJQZDHlVRcoCsv8fskikLgYhFks5tgF-ugaJpZM4Qc2J4 .

    It worked for me. But why/how?

  27. dzid26 commented on May 1, 2023

    @dzid26

    I couldn't make it work with the proposed solutions on Ubuntu 20.04 on WSL.

    Error: Cannot find module 
    ...   node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-x64/node_sqlite3.node'
    

    But using yarn I had no problems.
    yarn add sqlite3

  28. AviBueno commented on May 26, 2023

    @AviBueno

    TL;DR: Solved on Raspberry Pi 3 by installing the 64 bit OS image.

    Turns out that the default OS on the Raspberry Pi Imager is 32-bit (ARCH=arm). After selecting the 64-bit image (ARCH=arm64) all issues were solved because node-sqlite3's release includes napi-v6-linux-glibc-arm64.tar.gz out of the box, so no need to build locally (which got stuck forever on 100% CPU utilization).

  29. swen-chan commented on Jul 12, 2024

    @swen-chan

    I met the same error and tried a lot of ways but this work for me.
    npm rebuild

  30. pzHong0618 commented on Aug 20, 2025

    @pzHong0618

    我也是遇到了这个问题,我的环境如下:
    Nodejs 10.15.3
    sqlite3 5.0.0
    我是把node_modules\sqlite3\lib\sqlite3-binding.js里面的binding_path 的取值修改如下就解决了
    var binding_path = process.env.NODE_ENV === 'production'
    ? binary.find(path.resolve(path.join(process.execPath, '../package.json')))
    : binary.find(path.resolve(path.join(__dirname, '../package.json')));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions