# Conflict between node-red-node-sqlite and node-red-contrib-sqlitedb

**URL:** <https://discourse.nodered.org/t/conflict-between-node-red-node-sqlite-and-node-red-contrib-sqlitedb/40736>\
**Category:** General\
**Created:** [10 February 2021 08:52 UTC](https://discourse.nodered.org/t/conflict-between-node-red-node-sqlite-and-node-red-contrib-sqlitedb/40736 "2021-02-10T08:52:34Z")\
**Posts on this page:** 9\
**Page:** 2

<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:** [27 March 2021 16:53 UTC](https://discourse.nodered.org/t/conflict-between-node-red-node-sqlite-and-node-red-contrib-sqlitedb/40736/21 "2021-03-27T16:53:20Z")

</div>

So both node-red-contrib-mysensors and node-red-node-sqlite are complaining about the same missing module.

Have you installed sqlite3. On a normal Ubuntu that would be  
`sudo apt install sqlite3`  
but how that relates to your container I don't know.

---

<div class="post-metadata">

**Author:** ![rikki78](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rikki78/32/36865_2.png) [@rikki78](https://discourse.nodered.org/u/rikki78)\
**Post date:** [28 March 2021 05:33 UTC](https://discourse.nodered.org/t/conflict-between-node-red-node-sqlite-and-node-red-contrib-sqlitedb/40736/22 "2021-03-28T05:33:26Z")

</div>

I can't find this in this container at least. sqlite is used by home assistant also, so it is on the system somewhere but this may not be reachable from this container.  
Is this a dependency which is needed by the node, wouldn't it be installed automatically?

---

<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:** [28 March 2021 08:39 UTC](https://discourse.nodered.org/t/conflict-between-node-red-node-sqlite-and-node-red-contrib-sqlitedb/40736/23 "2021-03-28T08:39:43Z")

</div>

> [@rikki78](#):
>
> wouldn't it be installed automatically?

I would have thought so to, but apparently it is not, or perhaps the install of that failed. What do these commands show  
`npm list sqlite3`  
`npm list -g sqlite3`

---

<div class="post-metadata">

**Author:** ![rikki78](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rikki78/32/36865_2.png) [@rikki78](https://discourse.nodered.org/u/rikki78)\
**Post date:** [28 March 2021 09:15 UTC](https://discourse.nodered.org/t/conflict-between-node-red-node-sqlite-and-node-red-contrib-sqlitedb/40736/24 "2021-03-28T09:15:29Z")

</div>

This is shown:

```auto

root@a0d7b954-nodered:/opt$ npm list sqlite3
addon-node-red@ /opt
└── (empty)

root@a0d7b954-nodered:/opt$ npm list -g sqlite3

/usr/lib
└── (empty)

root@a0d7b954-nodered:/opt$

```

---

<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:** [28 March 2021 09:46 UTC](https://discourse.nodered.org/t/conflict-between-node-red-node-sqlite-and-node-red-contrib-sqlitedb/40736/25 "2021-03-28T09:46:26Z")

</div>

Very odd, on my system the sqlite node has pulled that in. Can you post your package.json and package-lock.json please. I guess they should be in /config/node-red.

---

<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:** [28 March 2021 10:39 UTC](https://discourse.nodered.org/t/conflict-between-node-red-node-sqlite-and-node-red-contrib-sqlitedb/40736/26 "2021-03-28T10:39:26Z")

</div>

If Node-RED is running in a container then the node needs to be installed inside the container. In order for that to happen then the container may need tools in order to compile the required binaries - so they also need to be available inside the container. I don't know which container HA are using but it would be up to them (or you) to ensure those tools are available in order to compile nodes like this that require a binary component.

---

<div class="post-metadata">

**Author:** ![rikki78](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rikki78/32/36865_2.png) [@rikki78](https://discourse.nodered.org/u/rikki78)\
**Post date:** [28 March 2021 11:27 UTC](https://discourse.nodered.org/t/conflict-between-node-red-node-sqlite-and-node-red-contrib-sqlitedb/40736/27 "2021-03-28T11:27:15Z")

</div>

I think I have to add sqlite as npm package in the configuration of the container. I will give it a try and let you know the result.

---

<div class="post-metadata">

**Author:** ![rikki78](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rikki78/32/36865_2.png) [@rikki78](https://discourse.nodered.org/u/rikki78)\
**Post date:** [29 March 2021 10:32 UTC](https://discourse.nodered.org/t/conflict-between-node-red-node-sqlite-and-node-red-contrib-sqlitedb/40736/28 "2021-03-29T10:32:35Z")

</div>

I've now added the sqlite3 to the npm packages to be installed in the node red container. This is the output below.  
I guess I need to install the tools like @dceejay mentioned. Which tools do I need to add?

```auto

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] customizations.sh: executing... 
[12:29:07] INFO: Starting installation of custom NPM/Node-RED packages...
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@5.0.2 install /opt/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
internal/modules/cjs/loader.js:883
  throw err;
  ^
Error: Cannot find module 'os-homedir'
Require stack:
- /opt/node_modules/osenv/osenv.js
- /opt/node_modules/sqlite3/node_modules/nopt/lib/nopt.js
- /opt/node_modules/sqlite3/node_modules/node-pre-gyp/lib/node-pre-gyp.js
- /opt/node_modules/sqlite3/node_modules/node-pre-gyp/bin/node-pre-gyp
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/opt/node_modules/osenv/osenv.js:5:17)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/opt/node_modules/osenv/osenv.js',
    '/opt/node_modules/sqlite3/node_modules/nopt/lib/nopt.js',
    '/opt/node_modules/sqlite3/node_modules/node-pre-gyp/lib/node-pre-gyp.js',
    '/opt/node_modules/sqlite3/node_modules/node-pre-gyp/bin/node-pre-gyp'
  ]
}
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.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-03-29T10_29_15_430Z-debug.log
[12:29:15] FATAL: Failed to install a specified npm package
[cont-init.d] customizations.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.

 We are so sorry, but something went terribly wrong when
 starting or running this add-on.
 
 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 May 2021 10:33 UTC](https://discourse.nodered.org/t/conflict-between-node-red-node-sqlite-and-node-red-contrib-sqlitedb/40736/29 "2021-05-28T10:33:24Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/conflict-between-node-red-node-sqlite-and-node-red-contrib-sqlitedb/40736.md?page=1)
