# Node-red-node-sqlite npm install node-gyp problem

**URL:** <https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716>\
**Category:** Share Your Projects\
**Created:** [25 October 2021 15:20 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716 "2021-10-25T15:20:16Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josari](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Josari](https://discourse.nodered.org/u/Josari)\
**Post date:** [25 October 2021 15:20 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/1 "2021-10-25T15:20:16Z")

</div>

Hi all,

I am currently working with node-red on a raspberry pi 3B+. The problem begins when I try to install node-red-node-sqlite node. This happens when I try to install the nodes from node-red pallete or when I execute 'npm install' through the terminal.

I would really appreciate if someone have experienced to share possible solutions. I've been trying to solve it for a couple days now,

This is the error log:  
npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future

> sqlite3@4.2.0 install /home/pi/.node-red/node\_modules/sqlite3

> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download

node-pre-gyp WARN Tried to download(403): [https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v83-linux-arm.tar.gz](https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v83-linux-arm.tar.gz)

node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.2.0 and node@14.18.1 (node-v83 ABI, glibc) (falling back to source compile with node-gyp)

gyp WARN install got an error, rolling back install

gyp ERR! configure error

gyp ERR! stack Error: read ECONNRESET

gyp ERR! stack at TLSWrap.onStreamRead (internal/stream\_base\_commons.js:209:20)

gyp ERR! System Linux 4.19.66-v7+

gyp ERR! command "/usr/bin/node" "/usr/lib/node\_modules/npm/node\_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/pi/.node-red/node\_modules/sqlite3/lib/binding/node-v83-linux-arm/node\_sqlite3.node" "--module\_name=node\_sqlite3" "--module\_path=/home/pi/.node-red/node\_modules/sqlite3/lib/binding/node-v83-linux-arm" "--napi\_version=8" "--node\_abi\_napi=napi" "--napi\_build\_version=0" "--node\_napi\_label=node-v83"

gyp ERR! cwd /home/pi/.node-red/node\_modules/sqlite3

gyp ERR! node -v v14.18.1

gyp ERR! node-gyp -v v5.1.0

gyp ERR! not ok

node-pre-gyp ERR! build error

node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node\_modules/npm/node\_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/pi/.node-red/node\_modules/sqlite3/lib/binding/node-v83-linux-arm/node\_sqlite3.node --module\_name=node\_sqlite3 --module\_path=/home/pi/.node-red/node\_modules/sqlite3/lib/binding/node-v83-linux-arm --napi\_version=8 --node\_abi\_napi=napi --napi\_build\_version=0 --node\_napi\_label=node-v83' (1)

node-pre-gyp ERR! stack at ChildProcess. (/home/pi/.node-red/node\_modules/node-pre-gyp/lib/util/compile.js:83:29)

node-pre-gyp ERR! stack at ChildProcess.emit (events.js:400:28)

node-pre-gyp ERR! stack at maybeClose (internal/child\_process.js:1058:16)

node-pre-gyp ERR! stack at Process.ChildProcess.\_handle.onexit (internal/child\_process.js:293:5)

node-pre-gyp ERR! System Linux 4.19.66-v7+

node-pre-gyp ERR! command "/usr/bin/node" "/home/pi/.node-red/node\_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"

node-pre-gyp ERR! cwd /home/pi/.node-red/node\_modules/sqlite3

node-pre-gyp ERR! node -v v14.18.1

node-pre-gyp ERR! node-pre-gyp -v v0.11.0

node-pre-gyp ERR! not ok

Failed to execute '/usr/bin/node /usr/lib/node\_modules/npm/node\_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/pi/.node-red/node\_modules/sqlite3/lib/binding/node-v83-linux-arm/node\_sqlite3.node --module\_name=node\_sqlite3 --module\_path=/home/pi/.node-red/node\_modules/sqlite3/lib/binding/node-v83-linux-arm --napi\_version=8 --node\_abi\_napi=napi --napi\_build\_version=0 --node\_napi\_label=node-v83' (1)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! sqlite3@4.2.0 install: `node-pre-gyp install --fallback-to-build`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the sqlite3@4.2.0 install script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR! /home/pi/.npm/\_logs/2021-10-20T16\_30\_48\_019Z-debug.log

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 October 2021 15:38 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/2 "2021-10-25T15:38:10Z")

</div>

Welcome to the forum @Josari

Are you running under a corporate (or other) firewall of some sort? Or is your internet connection unstable?

---

<div class="post-metadata">

**Author:** ![Josari](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Josari](https://discourse.nodered.org/u/Josari)\
**Post date:** [25 October 2021 20:26 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/3 "2021-10-25T20:26:42Z")

</div>

It is under a corporate firewall but I was able to install sqlite before without any problem in the same raspberry.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 October 2021 21:08 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/4 "2021-10-25T21:08:08Z")

</div>

How did you install node-red? Did you use the [recommended script](https://nodered.org/docs/getting-started/raspberrypi)?

If not then I suggest you run the script to make sure you have a consistent set of s/w.

However, before that run  
`sudo apt update`  
`sudo apt full-upgrade`  
to make sure your system is up to date.

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [25 October 2021 22:06 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/5 "2021-10-25T22:06:48Z")

</div>

also can you show us the command you used to install the **node-red-node-sqlite** node from the terminal ?

what strikes me as strange from the error log is that it tries to install version `sqlite3@4.2.0`  
but the sqlite node was updated recently and its sqlite dependency is `"sqlite3": "^5.0.2"`

the correct command to install the node is  
`npm i --unsafe-perm node-red-node-sqlite`  
from your Node-RED user directory - typically `~/.node-red`  
([source](https://github.com/node-red/node-red-nodes/tree/master/storage/sqlite))

---

<div class="post-metadata">

**Author:** ![Josari](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Josari](https://discourse.nodered.org/u/Josari)\
**Post date:** [26 October 2021 15:13 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/7 "2021-10-26T15:13:46Z")

</div>

I used the recommended script to install node-red. I used "sudo apt updtate" and "sudo apt full-upgrade".

---

<div class="post-metadata">

**Author:** ![Josari](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Josari](https://discourse.nodered.org/u/Josari)\
**Post date:** [26 October 2021 15:23 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/8 "2021-10-26T15:23:56Z")

</div>

The way I tried to install it from terminal was by a "npm install". I incuded node-red-node-sqllite on my package.json.

I've just tried npm i --unsafe-perm node-red-node-sqlite but the result is the same.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 October 2021 15:27 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/9 "2021-10-26T15:27:51Z")

</div>

> [@Josari](#):
>
> I incuded node-red-node-sqllite on my package.json.

What did you add to package.json and why did you not just use npm to install it?

---

<div class="post-metadata">

**Author:** ![Josari](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Josari](https://discourse.nodered.org/u/Josari)\
**Post date:** [26 October 2021 15:38 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/10 "2021-10-26T15:38:55Z")

</div>

The project I'm working on uses more nodes, so this is my package.json.

"name": "node-red-project",  
"description": "initially created for you by Node-RED 2.1.0 ",  
"version": "0.0.1",  
"private": true,  
"dependencies": {  
"node-red-contrib-bcrypt": "0.0.49",  
"node-red-contrib-cip-ethernet-ip": "~1.1.2",  
"node-red-contrib-ip": "~1.0.1",  
"node-red-contrib-modbus": "~5.13.2",  
"node-red-contrib-mssql-plus": "~0.5.1",  
"node-red-contrib-omron-fins": "~0.1.3",  
"node-red-contrib-s7": "~3.0.0-beta.3",  
"node-red-node-sqlite": "^0.6.0"  
}  
}

The other nodes were installed without any problem but sqlite node didn't when I added t.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 October 2021 15:41 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/11 "2021-10-26T15:41:17Z")

</div>

> [@Josari](#):
>
> "node-red-node-sqlite": "^0.6.0"

Why are you trying to install an ancient version? It is at 1.0.1 now. Unless you need that version delete that line and run the command to install the node.

If that is how you also installed the other nodes then you might have old versions of those too.

---

<div class="post-metadata">

**Author:** ![Josari](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Josari](https://discourse.nodered.org/u/Josari)\
**Post date:** [26 October 2021 15:47 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/12 "2021-10-26T15:47:06Z")

</div>

When I tried to download it from node-red's pallete the version I was trying to download was in fact the newest one (1.0.1) but I had the same problem on my log.

I've just changed the version in my package.json to 1.0.1 and the result is the same.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 October 2021 15:52 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/13 "2021-10-26T15:52:03Z")

</div>

> [@Josari](#):
>
> I've just changed the version in my package.json to 1.0.1 and the result is the same.

Why? Remove it from package.json and let npm do it.

What do these show  
`node -v`  
`npm -v`

And show us the full output from the npm command, including the command you enter.

---

<div class="post-metadata">

**Author:** ![Josari](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Josari](https://discourse.nodered.org/u/Josari)\
**Post date:** [26 October 2021 15:57 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/14 "2021-10-26T15:57:48Z")

</div>

I removed every node from package.json and executed the following commands:

pi@raspberrypi3:~/.node-red $ npm install  
removed 223 packages in 10.976s  
found 0 vulnerabilities

pi@raspberrypi3:~/.node-red $ node -v  
v14.18.1

npm -v  
6.14.15

npm i --unsafe-perm node-red-node-sqlite  
npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future  
npm WARN deprecated request@2.88.2: request has been deprecated, see [https://github.com/request/request/issues/3142](https://github.com/request/request/issues/3142)  
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.  
npm WARN deprecated har-validator@5.1.5: this library is no longer supported  
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See [There’s Math.random(), and then there’s Math.random() · V8](https://v8.dev/blog/math-random) for details.

> sqlite3@5.0.2 install /home/pi/.node-red/node\_modules/sqlite3  
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download  
node-pre-gyp WARN Tried to download(403)  
node-pre-gyp WARN Pre-built binaries not found for sqlite3@5.0.2 and node@14.18.1 (node-v83 ABI, glibc) (falling back to source compile with node-gyp)  
gyp WARN install got an error, rolling back install  
gyp ERR! configure error  
gyp ERR! stack Error: read ECONNRESET  
gyp ERR! stack at TLSWrap.onStreamRead (internal/stream\_base\_commons.js:209:20)  
gyp ERR! System Linux 5.10.63-v7+  
gyp ERR! command "/usr/bin/node" "/usr/lib/node\_modules/npm/node\_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/pi/.node-red/node\_modules/sqlite3/lib/binding/napi-v3-linux-arm/node\_sqlite3.node" "--module\_name=node\_sqlite3" "--module\_path=/home/pi/.node-red/node\_modules/sqlite3/lib/binding/napi-v3-linux-arm" "--napi\_version=8" "--node\_abi\_napi=napi" "--napi\_build\_version=3" "--node\_napi\_label=napi-v3"  
gyp ERR! cwd /home/pi/.node-red/node\_modules/sqlite3  
gyp ERR! node -v v14.18.1  
gyp ERR! node-gyp -v v5.1.0  
gyp ERR! not ok  
node-pre-gyp ERR! build error  
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node\_modules/npm/node\_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/pi/.node-red/node\_modules/sqlite3/lib/binding/napi-v3-linux-arm/node\_sqlite3.node --module\_name=node\_sqlite3 --module\_path=/home/pi/.node-red/node\_modules/sqlite3/lib/binding/napi-v3-linux-arm --napi\_version=8 --node\_abi\_napi=napi --napi\_build\_version=3 --node\_napi\_label=napi-v3' (1)  
node-pre-gyp ERR! stack at ChildProcess. (/home/pi/.node-red/node\_modules/node-pre-gyp/lib/util/compile.js:83:29)  
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:400:28)  
node-pre-gyp ERR! stack at maybeClose (internal/child\_process.js:1058:16)  
node-pre-gyp ERR! stack at Process.ChildProcess.\_handle.onexit (internal/child\_process.js:293:5)  
node-pre-gyp ERR! System Linux 5.10.63-v7+  
node-pre-gyp ERR! command "/usr/bin/node" "/home/pi/.node-red/node\_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"  
node-pre-gyp ERR! cwd /home/pi/.node-red/node\_modules/sqlite3  
node-pre-gyp ERR! node -v v14.18.1  
node-pre-gyp ERR! node-pre-gyp -v v0.11.0  
node-pre-gyp ERR! not ok  
Failed to execute '/usr/bin/node /usr/lib/node\_modules/npm/node\_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/pi/.node-red/node\_modules/sqlite3/lib/binding/napi-v3-linux-arm/node\_sqlite3.node --module\_name=node\_sqlite3 --module\_path=/home/pi/.node-red/node\_modules/sqlite3/lib/binding/napi-v3-linux-arm --napi\_version=8 --node\_abi\_napi=napi --napi\_build\_version=3 --node\_napi\_label=napi-v3' (1)  
npm ERR! code ELIFECYCLE  
npm ERR! errno 1  
npm ERR! sqlite3@5.0.2 install: `node-pre-gyp install --fallback-to-build`  
npm ERR! Exit status 1  
npm ERR!  
npm ERR! Failed at the sqlite3@5.0.2 install script.  
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 October 2021 16:04 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/15 "2021-10-26T16:04:28Z")

</div>

Well I think we are back to the firewall then. Unless anyone else has any ideas. Something is causing the ECONNRESET, which is a network problem of some sort.

Can you temporarily move the pi outside of the corporate network and try again?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 October 2021 16:07 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/16 "2021-10-26T16:07:11Z")

</div>

> [@Josari](#):
>
> gyp ERR! stack Error: read ECONNRESET

This might help, I don't know though. [node.js - How to fix gyp-ERR ECONNRESET? - Stack Overflow](https://stackoverflow.com/questions/52535095/how-to-fix-gyp-err-econnreset)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 October 2021 16:23 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/17 "2021-10-26T16:23:02Z")

</div>

I don't think this is the problem, but have you installed the build tools  
`sudo apt install build-essential git curl`

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [26 October 2021 16:47 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/18 "2021-10-26T16:47:45Z")

</div>

and maybe do a `npm cache clean --force` in case there are traces of the old build in there.

---

<div class="post-metadata">

**Author:** ![Josari](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Josari](https://discourse.nodered.org/u/Josari)\
**Post date:** [5 November 2021 17:03 UTC](https://discourse.nodered.org/t/node-red-node-sqlite-npm-install-node-gyp-problem/52716/19 "2021-11-05T17:03:22Z")

</div>

Hi all,  
I'm back with an update.  
I did some tests on different raspberry's.

I used the following commands on a raspberry 4 and a raspberry 3b+ that are not in the same network the other is.

sudo apt update  
sudo apt full-upgrade  
sudo apt install build-essential git curl  
And the recommended installation.

On both raspberries I had no problem when installing sqlite.  
Is there any way to evade whatever the corporate firewall could be blocking?
