Unable to install the @ncd-io/node-red-enterprise-sensors library

I’m getting the following when trying to install the @ncd-io/node-red-enterprise-sensors library:

2025-01-03T15:37:13.140Z Install : @ncd-io/node-red-enterprise-sensors 1.1.3

2025-01-03T15:37:13.212Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict @ncd-io/node-red-enterprise-sensors@1.1.3
2025-01-03T15:37:14.589Z [err] npm
2025-01-03T15:37:14.590Z [err]  WARN 
2025-01-03T15:37:14.590Z [err] config production Use `--omit=dev` instead.
2025-01-03T15:37:21.900Z [err] npm
2025-01-03T15:37:21.901Z [err]  ERR! code EBADENGINE
2025-01-03T15:37:21.907Z [err] npm ERR! engine
2025-01-03T15:37:21.907Z [err]  Unsupported engine
2025-01-03T15:37:21.908Z [err] npm ERR! engine Not compatible with your version of node/npm: gateway-mqtt-proccessor@1.0.0
2025-01-03T15:37:21.909Z [err] npm ERR! notsup Not compatible with your version of node/npm: gateway-mqtt-proccessor@1.0.0
2025-01-03T15:37:21.909Z [err] npm ERR! notsup Required: {"node":"14"}
2025-01-03T15:37:21.909Z [err] npm ERR! notsup Actual:   {"npm":"10.2.3","node":"v18.19.0"}
2025-01-03T15:37:21.917Z [err] 
2025-01-03T15:37:21.917Z [err] npm
2025-01-03T15:37:21.918Z [err]  
2025-01-03T15:37:21.918Z [err] ERR!
2025-01-03T15:37:21.918Z [err]  A complete log of this run can be found in: /data/.npm/_logs/2025-01-03T15_37_14_431Z-debug-0.log
2025-01-03T15:37:21.941Z rc=1

Some observations:

  1. I’m trying to install into a container running the official Node-RED Docker image, so I think the versions of npm and node that I’m running are reasonable.
  2. The library is missing the node version (per node-red-enterprise-sensors (node) - Node-RED)

What can I do to get this installed?

Thanks! :slight_smile:

Hi,

The error itself appears to be coming from a module called “gateway-mqtt-proccessor” which I can find not mention of anywhere on google and our library doesn’t reference it. By all appearances you have a module called gateway-mqtt-proccessor that needs updated or removed that is throwing these errors. npm install will throw these errors even when installing unrelated modules.

We require node-red version 2 or higher which dictates nodejs 12.17.0 or higher.

gateway-mqtt-proccessor is just the (custom) name of the Node-RED Docker container. So roughly this is like the base OS kicking out the error.

I think this is happening because the library’s package.json doesn’t contain anything like this for the nodejs version (though it does for the node-red version):

"engines": {
  "node": ">=12.17.0"
}

From a quick search:

The npm WARN EBADENGINE Unsupported engine warning indicates that the version of Node.js you are using does not meet the requirements specified by certain packages in your package.json file. This issue often arises when the engines field in package.json specifies a required Node.js version that does not match the currently installed version.

FWIW, I’m running the nodered/node-red:3.1.5-18 Docker image, so Node-RED v3.1.5 running on Node v18.

I’m going to try pre-compiling it into the Docker image… that will likely resolve it…

It would be unusual and specific to docker if not having a minimum version of nodejs was listed. We can add it in the next update, but it has never been an issue before on any platform. I believe when I was experimenting with docker I used something like this dockerfile:

From nodered/node-red:3.0.0-18

#Users should be sure to pass in a port to use for Node-Red
#EXPOSE 1880

#recommended setting test without and then test with
#ENV NODE_ENV=production

#set working directory to ~/.node-red to install all packages necessary there
WORKDIR ~/.node-red

RUN npm install @ncd-io/node-red-enterprise-sensors

I never fully got around to supporting docker due to the difficulties with Serial Port context on everything except linux. Should be cross compatible via Ethernet module though.

** Edit: You’ll probably want to change the version specified in the From line to be more up to date

Yeah, building it into the image is working. FWIW, I have been using this approach for a few years:

  1. In the Node-RED project’s package.json, I add the nodes, like "dependencies": { "@ncd-io/node-red-enterprise-sensors": "1.1.3" }
  2. The Node-RED project’s DOCKERFILE looks like this:
FROM nodered/node-red:3.1.5-18

# Copy package.json to /data so npm installs the added modules for Node-RED
COPY package.json /data/package.json

RUN cd /data && npm install --only=production

COPY settings.js /data/settings.js
COPY flows_cred.json /data/flows_cred.json
COPY flows.json /data/flows.json

# Start the container normally
CMD ["npm", "start"]

And yeah, getting the port poked through to the container takes a little extra config on the container.

The serial port issue is the biggest hurdle in my experience. I could never get it to function from Windows and Mac didn’t support it at all oddly enough. Maybe it was because I was running Alpine on the container and most people that I saw have success were using Debian/Ubuntu