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

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

Closed
Thavaprakash opened this issue Nov 14, 2017 · 43 comments

Comments

@Thavaprakash
Copy link

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

@heyfgirl
Copy link

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

@damianobarbati
Copy link

@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

@wmertens
Copy link
Contributor

Duplicate of #902

@chujinjin101
Copy link

chujinjin101 commented Mar 20, 2018

@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

@wmertens
Copy link
Contributor

wmertens commented Mar 20, 2018 via email

@memePushpendu
Copy link

Where should i run "npm rebuild" ?

@wmertens
Copy link
Contributor

wmertens commented Jun 18, 2018 via email

@springmeyer
Copy link
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

@hanpari
Copy link

hanpari commented Jul 30, 2018

Same issue as well. Trying to solve on SO:
https://stackoverflow.com/questions/51587843/how-to-add-sqlite3-dependency-to-vs-code-extension

node -v
v9.4.0

@arunasank
Copy link

arunasank commented Nov 13, 2018

Another workaround that worked for me:
npm uninstall sqlite3

and then:

npm install --save sqlite3

@TimDorand
Copy link

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

@reya276
Copy link

reya276 commented Jan 18, 2019

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

@kewde
Copy link
Collaborator

kewde commented Jan 19, 2019

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

@reya276
Copy link

reya276 commented Jan 19, 2019 via email

@janeksz
Copy link

janeksz commented Feb 19, 2019

Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/root/.node-red/node_modules/usb/src/binding/usb_bindings.node --module_name=usb_bindings --module_path=/root/.node-red/node_modules/usb/src/binding --napi_version=2 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v59' (1)

root@RPi3AP:# node -v
v9.9.0
root@RPi3AP:
# npm -v
5.6.0
root@RPi3AP:~#

@alettaklopper2310
Copy link

running npm rebuild solved it for me

@PrashantTapase
Copy link

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

Added more plateforms v8.x, v10.x, v11.x and v12.x.

@arcanzi0418
Copy link

arcanzi0418 commented Jun 13, 2019

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

Did you fix this problem?
How did you fix?

@kewde
Copy link
Collaborator

kewde commented Jun 13, 2019

@arnielcanillo the binaries for node-sqlite3 are downloaded a installation. If you've upgraded your version of Node then you have to re-install node-sqlite3.

@aa21
Copy link

aa21 commented Dec 3, 2019

I had this issue on Mac. Followed these steps:

# you need brew and nvm
brew install nvm

cd /var/www/gekko

#removed brew version of node
brew uninstall node
#removed all nvm versions of node
rm -rf ~/.nvm/versions/node/*

#stable version of node and nvm that works for gekko
nvm install 9.10.1
nvm alias default 9.10.1

#install gekko modules 
npm install --only=production
cd exchange
npm install --only=production
cd ..

#remove sqlite, tulip and talib
rm -rf ./node_modules/talib*
rm -rf ./node_modules/tulind*
rm -rf ./node_modules/sqlite3*

#Install tulip, sqlite and talib versions that are compatible
npm install talib@1.0.4 --no-save
npm install tulind@0.8.10 --no-save
npm install sqlite3@4.0.0  --save 

@RajVisionware
Copy link

Another workaround that worked for me:
npm uninstall sqlite3

and then:

npm install --save sqlite3

Nice working for me

@lucasgabrielsantos
Copy link

@arunasank You the best! Thank you <3

@epsoftware
Copy link

Another workaround that worked for me:
npm uninstall sqlite3
and then:
npm install --save sqlite3

Nice working for me

@epsoftware
Copy link

Awesome. Works great!

@IbrahimSam96
Copy link

@arunasank Your Amazing ! Thanks Alot

@rmit-s3712674-Sijie-Shi

@wmertens Thanks, problem solved.

@iSamuelCO
Copy link

@arunasank Thanks!

@nikhilpk26
Copy link

nikhilpk26 commented Dec 8, 2020

Node
v12.11.1
npm
6.11.3
OS
ubuntu 18.04 LTS

this issue is still existing. I went through all workaround described in this thread. I didn't get any solution
Help me please

@Miltonr87
Copy link

Same like @nikhilpk26 .

OS: Linux Mint 20 (Ubuntu derivation)
Node: v14.15.1 (but i tried older versions and not resolved).
NPM: 6.14.8

@andrewshell
Copy link

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.

@Miltonr87
Copy link

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!

@i-chaochen
Copy link

i-chaochen commented Feb 4, 2021

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

@marcoguastalli
Copy link

marcoguastalli commented Apr 14, 2021

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

@miragekamran
Copy link

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

@wmertens
Copy link
Contributor

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

@MegaNoam
Copy link

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

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

@wmertens
Copy link
Contributor

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

@andyrobert3
Copy link

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!

@akshayjain-tmdc
Copy link

akshayjain-tmdc commented Apr 18, 2022

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

@saifookhan
Copy link

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?

@dzid26
Copy link

dzid26 commented May 1, 2023

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

@AviBueno
Copy link

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).

@swen-chan
Copy link

swen-chan commented Jul 12, 2024

I met the same error and tried a lot of ways but this work for me.
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