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

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.

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?

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

This is shown:


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$

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.

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.

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.

1 Like

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?


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

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