maxwellhadley / node-red-contrib-rfxcom

node-RED nodes to access an RFXtrx433 transceiver
BSD 2-Clause "Simplified" License
22 stars 13 forks source link

rfxcom node doesn't work with Node-Red v3 #124

Open doomedsardines opened 1 year ago

doomedsardines commented 1 year ago

Node is not working after upgrade of Node-Red to version 3. The following error is displayed:

Screenshot 2022-10-18 at 17 14 11
maxwellhadley commented 1 year ago

As far as I know there are no issues running on Node-RED version 3. Please take a look at issues #121 and #123 and see if the actions proposed there solve your problem

doomedsardines commented 1 year ago

Strangely, reinstalling doesn't work for me. Following is the debug out put:

2022-10-19T13:46:37.765Z Install : node-red-contrib-rfxcom 2.11.3

2022-10-19T13:46:37.838Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-rfxcom@2.11.3 2022-10-19T13:46:38.378Z [err] npm 2022-10-19T13:46:38.378Z [err] WARN config 2022-10-19T13:46:38.378Z [err] production Use --omit=dev instead. 2022-10-19T13:46:40.190Z [err] npm 2022-10-19T13:46:40.190Z [err] WARN deprecated date-format@3.0.0: 3.x is no longer supported. Please upgrade to 4.x or higher. 2022-10-19T13:46:43.744Z [err] npm 2022-10-19T13:46:43.744Z [err] ERR! 2022-10-19T13:46:43.744Z [err] code 1 2022-10-19T13:46:43.744Z [err] npm ERR! 2022-10-19T13:46:43.744Z [err] path /data/node_modules/@serialport/bindings 2022-10-19T13:46:43.746Z [err] npm ERR! 2022-10-19T13:46:43.746Z [err] command failed 2022-10-19T13:46:43.746Z [err] npm 2022-10-19T13:46:43.746Z [err] ERR! command sh -c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild 2022-10-19T13:46:43.746Z [err] npm 2022-10-19T13:46:43.746Z [err] ERR! make: Entering directory '/data/node_modules/@serialport/bindings/build' 2022-10-19T13:46:43.746Z [err] npm ERR! 2022-10-19T13:46:43.746Z [err] make: Leaving directory '/data/node_modules/@serialport/bindings/build' 2022-10-19T13:46:43.747Z [err] npm 2022-10-19T13:46:43.747Z [err] ERR! prebuild-install warn install No prebuilt binaries found (target=16.16.0 runtime=node arch=x64 libc=musl platform=linux) 2022-10-19T13:46:43.747Z [err] npm 2022-10-19T13:46:43.747Z [err] ERR! 2022-10-19T13:46:43.747Z [err] gyp info it worked if it ends with ok 2022-10-19T13:46:43.747Z [err] npm ERR! 2022-10-19T13:46:43.747Z [err] gyp info using node-gyp@9.0.0 2022-10-19T13:46:43.747Z [err] npm ERR! gyp info using node@16.16.0 | linux | x64 2022-10-19T13:46:43.747Z [err] npm 2022-10-19T13:46:43.747Z [err] ERR! gyp info find Python using Python version 3.10.5 found at "/usr/bin/python3" 2022-10-19T13:46:43.747Z [err] npm 2022-10-19T13:46:43.747Z [err] ERR! gyp WARN EACCES current user ("node-red") does not have permission to access the dev dir "/root/.cache/node-gyp/16.16.0" 2022-10-19T13:46:43.747Z [err] npm 2022-10-19T13:46:43.747Z [err] ERR! gyp WARN EACCES attempting to reinstall using temporary dev dir "/tmp/.node-gyp" 2022-10-19T13:46:43.747Z [err] npm ERR! 2022-10-19T13:46:43.747Z [err] gyp http GET https://unofficial-builds.nodejs.org/download/release/v16.16.0/node-v16.16.0-headers.tar.gz 2022-10-19T13:46:43.747Z [err] npm ERR! 2022-10-19T13:46:43.747Z [err] gyp http 200 https://unofficial-builds.nodejs.org/download/release/v16.16.0/node-v16.16.0-headers.tar.gz 2022-10-19T13:46:43.747Z [err] npm ERR! gyp http GET https://unofficial-builds.nodejs.org/download/release/v16.16.0/SHASUMS256.txt 2022-10-19T13:46:43.747Z [err] npm ERR! gyp http 200 https://unofficial-builds.nodejs.org/download/release/v16.16.0/SHASUMS256.txt 2022-10-19T13:46:43.747Z [err] npm 2022-10-19T13:46:43.747Z [err] ERR! gyp info spawn /usr/bin/python3 2022-10-19T13:46:43.747Z [err] npm ERR! 2022-10-19T13:46:43.747Z [err] gyp info spawn args [ 2022-10-19T13:46:43.747Z [err] npm ERR! 2022-10-19T13:46:43.748Z [err] gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', 2022-10-19T13:46:43.748Z [err] npm ERR! gyp info spawn args 'binding.gyp', 2022-10-19T13:46:43.748Z [err] npm ERR! gyp info spawn args '-f', 2022-10-19T13:46:43.748Z [err] npm 2022-10-19T13:46:43.748Z [err] ERR! gyp info spawn args 'make', 2022-10-19T13:46:43.748Z [err] npm 2022-10-19T13:46:43.748Z [err] ERR! gyp info spawn args '-I', 2022-10-19T13:46:43.748Z [err] npm ERR! 2022-10-19T13:46:43.748Z [err] gyp info spawn args '/data/node_modules/@serialport/bindings/build/config.gypi', 2022-10-19T13:46:43.748Z [err] npm ERR! 2022-10-19T13:46:43.748Z [err] gyp info spawn args '-I', 2022-10-19T13:46:43.748Z [err] npm ERR! 2022-10-19T13:46:43.748Z [err] gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', 2022-10-19T13:46:43.748Z [err] npm ERR! gyp info spawn args '-I', 2022-10-19T13:46:43.748Z [err] npm ERR! gyp info spawn args '/tmp/.node-gyp/16.16.0/include/node/common.gypi', 2022-10-19T13:46:43.748Z [err] npm 2022-10-19T13:46:43.748Z [err] ERR! gyp info spawn args '-Dlibrary=shared_library', 2022-10-19T13:46:43.748Z [err] npm 2022-10-19T13:46:43.748Z [err] ERR! gyp info spawn args '-Dvisibility=default', 2022-10-19T13:46:43.748Z [err] npm 2022-10-19T13:46:43.748Z [err] ERR! gyp info spawn args '-Dnode_root_dir=/tmp/.node-gyp/16.16.0', 2022-10-19T13:46:43.748Z [err] npm ERR! 2022-10-19T13:46:43.748Z [err] gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp', 2022-10-19T13:46:43.748Z [err] npm ERR! 2022-10-19T13:46:43.748Z [err] gyp info spawn args '-Dnode_lib_file=/tmp/.node-gyp/16.16.0/<(target_arch)/node.lib', 2022-10-19T13:46:43.748Z [err] npm ERR! 2022-10-19T13:46:43.748Z [err] gyp info spawn args '-Dmodule_root_dir=/data/node_modules/@serialport/bindings', 2022-10-19T13:46:43.748Z [err] npm ERR! gyp info spawn args '-Dnode_engine=v8', 2022-10-19T13:46:43.748Z [err] npm ERR! gyp info spawn args '--depth=.', 2022-10-19T13:46:43.748Z [err] npm ERR! gyp info spawn args '--no-parallel', 2022-10-19T13:46:43.748Z [err] npm 2022-10-19T13:46:43.749Z [err] ERR! gyp info spawn args '--generator-output', 2022-10-19T13:46:43.749Z [err] npm 2022-10-19T13:46:43.749Z [err] ERR! gyp info spawn args 'build', 2022-10-19T13:46:43.749Z [err] npm ERR! 2022-10-19T13:46:43.749Z [err] gyp info spawn args '-Goutput_dir=.' 2022-10-19T13:46:43.749Z [err] npm ERR! 2022-10-19T13:46:43.749Z [err] gyp info spawn args ] 2022-10-19T13:46:43.749Z [err] npm ERR! 2022-10-19T13:46:43.749Z [err] gyp info spawn make 2022-10-19T13:46:43.749Z [err] npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] 2022-10-19T13:46:43.749Z [err] npm ERR! make: printf: Operation not permitted 2022-10-19T13:46:43.749Z [err] npm ERR! make: *** [bindings.target.mk:116: Release/obj.target/bindings/src/serialport.o] Error 127 2022-10-19T13:46:43.749Z [err] npm 2022-10-19T13:46:43.749Z [err] ERR! gyp ERR! build error 2022-10-19T13:46:43.749Z [err] npm 2022-10-19T13:46:43.749Z [err] ERR! gyp ERR! stack Error: make failed with exit code: 2 2022-10-19T13:46:43.749Z [err] npm 2022-10-19T13:46:43.749Z [err] ERR! gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) 2022-10-19T13:46:43.749Z [err] npm ERR! 2022-10-19T13:46:43.749Z [err] gyp ERR! stack at ChildProcess.emit (node:events:527:28) 2022-10-19T13:46:43.749Z [err] npm ERR! 2022-10-19T13:46:43.749Z [err] gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) 2022-10-19T13:46:43.749Z [err] npm ERR! 2022-10-19T13:46:43.749Z [err] gyp ERR! System Linux 4.15.0-189-generic 2022-10-19T13:46:43.749Z [err] npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 2022-10-19T13:46:43.749Z [err] npm ERR! gyp ERR! cwd /data/node_modules/@serialport/bindings 2022-10-19T13:46:43.749Z [err] npm ERR! gyp ERR! node -v v16.16.0 2022-10-19T13:46:43.749Z [err] npm ERR! gyp ERR! node-gyp -v v9.0.0 2022-10-19T13:46:43.749Z [err] npm 2022-10-19T13:46:43.749Z [err] ERR! gyp ERR! not ok 2022-10-19T13:46:43.751Z [err] 2022-10-19T13:46:43.752Z [err] npm ERR! 2022-10-19T13:46:43.752Z [err] A complete log of this run can be found in: 2022-10-19T13:46:43.752Z [err] npm ERR! /data/.npm/_logs/2022-10-19T13_46_38_337Z-debug-0.log

tenhercules commented 1 year ago

using distro diet-pi with clean node-red installation. Unable to install node-red-contrib-rfxcom.

2022-10-30T10:17:48.853Z Install : node-red-contrib-rfxcom 2.11.3

2022-10-30T10:17:48.235Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-rfxcom@2.11.3 2022-10-30T10:17:48.738Z [err] npm 2022-10-30T10:17:48.739Z [err]
2022-10-30T10:17:48.739Z [err] WARN 2022-10-30T10:17:48.739Z [err] config production Use --omit=dev instead. 2022-10-30T10:17:55.092Z [err] npm 2022-10-30T10:17:55.092Z [err] WARN deprecated date-format@3.0.0: 3.x is no longer supported. Please upgrade to 4.x or higher. 2022-10-30T10:17:56.384Z [err] npm

Strixx76 commented 1 year ago

Same here. Just upgraded to Node-RED 3.0.2 and node-red-contrib-rfxcom stopped working. I run Node-RED in docker from the official image.

Gets the following error in the logg: 19 Dec 11:24:56 - [warn] [node-red-contrib-rfxcom/rfxcom] Error: The module '/data/node_modules/@serialport/bindings/build/Release/bindings.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 83. This version of Node.js requires NODE_MODULE_VERSION 93. Please try re-compiling or re-installing the module (for instance, using 'npm rebuild' or 'npm install').

After manually uninstalling node-red-contrib-rfxcom, and then trying to add it again from the UI, I get the same error as previous posts. After hours of trying to manualy installing packages I gave up and reverted to version 2 of Node-Red.

maxwellhadley commented 1 year ago

@Strixx76 That is a NodeJS version problem, nothing to do with the Node-RED version. You need to go to the package directory of node-red-contrib-rfxcom's rfxcom dependency, and npm rebuild from there

maxwellhadley commented 1 year ago

@doomedsardines, @tenhercules: It looks like I need to update the version of date-format, but that isn't what is causing your issues, I think. Maybe something has been previously npm installed using sudo at some time?

Strixx76 commented 1 year ago

That is a NodeJS version problem, nothing to do with the Node-RED version. You need to go to the package directory of node-red-contrib-rfxcom's rfxcom dependency, and npm rebuild from there

As I wrote I did try that, and I tried rebuild only the serialport package. I tried to uninstall and reinstall the packages as well.

I will give it some more testing later today or tomorrow to see if I can figure out what is causing this.

Strixx76 commented 1 year ago

So I started up a brand new container with the official Node-RED image (nodered/node-red:3.0.2). And I am not able to install node-red-contrib-rfxcom 2.11.3. Nothing else is installed in this container.

This is the full log:

2022-12-29T14:52:36.289Z Install : node-red-contrib-rfxcom 2.11.3
2022-12-29T14:52:46.654Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-rfxcom@2.11.3
2022-12-29T14:52:47.310Z [err] npm
2022-12-29T14:52:47.310Z [err]  WARN 
2022-12-29T14:52:47.310Z [err] config production Use `--omit=dev` instead.
2022-12-29T14:52:56.106Z [err] npm
2022-12-29T14:52:56.107Z [err]  WARN deprecated date-format@3.0.0: 3.x is no longer supported. Please upgrade to 4.x or higher.
2022-12-29T14:53:00.097Z [err] npm ERR! code 1
2022-12-29T14:53:00.097Z [err] npm ERR! path /data/node_modules/@serialport/bindings
2022-12-29T14:53:00.099Z [err] npm ERR! command failed
2022-12-29T14:53:00.099Z [err] npm ERR! command sh -c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2022-12-29T14:53:00.099Z [err] npm ERR!
2022-12-29T14:53:00.100Z [err]  make: Entering directory '/data/node_modules/@serialport/bindings/build'
2022-12-29T14:53:00.100Z [err] npm ERR! make: Leaving directory '/data/node_modules/@serialport/bindings/build'
2022-12-29T14:53:00.100Z [err] npm ERR! prebuild-install warn install No prebuilt binaries found (target=16.16.0 runtime=node arch=x64 libc=musl platform=linux)
2022-12-29T14:53:00.100Z [err] npm ERR! gyp info it worked if it ends with ok
2022-12-29T14:53:00.100Z [err] npm 
2022-12-29T14:53:00.100Z [err] ERR! gyp info using node-gyp@9.0.0
2022-12-29T14:53:00.100Z [err] npm ERR! gyp info using node@16.16.0 | linux | x64
2022-12-29T14:53:00.100Z [err] npm ERR! gyp info find Python using Python version 3.10.5 found at "/usr/bin/python3"
2022-12-29T14:53:00.100Z [err] npm ERR! gyp http GET https://unofficial-builds.nodejs.org/download/release/v16.16.0/node-v16.16.0-headers.tar.gz
2022-12-29T14:53:00.100Z [err] npm ERR! gyp http 200 https://unofficial-builds.nodejs.org/download/release/v16.16.0/node-v16.16.0-headers.tar.gz
2022-12-29T14:53:00.100Z [err] npm ERR! gyp http GET https://unofficial-builds.nodejs.org/download/release/v16.16.0/SHASUMS256.txt
2022-12-29T14:53:00.100Z [err] npm ERR! gyp http 200 https://unofficial-builds.nodejs.org/download/release/v16.16.0/SHASUMS256.txt
2022-12-29T14:53:00.100Z [err] npm ERR! gyp info spawn /usr/bin/python3
2022-12-29T14:53:00.100Z [err] npm ERR! gyp info spawn args [
2022-12-29T14:53:00.100Z [err] npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
2022-12-29T14:53:00.100Z [err] npm ERR! gyp info spawn args   'binding.gyp',
2022-12-29T14:53:00.100Z [err] npm ERR! gyp info spawn args   '-f',
2022-12-29T14:53:00.100Z [err] npm ERR! gyp info spawn args   'make',
2022-12-29T14:53:00.100Z [err] npm ERR! gyp info spawn args   '-I',
2022-12-29T14:53:00.100Z [err] npm ERR! gyp info spawn args   '/data/node_modules/@serialport/bindings/build/config.gypi',
2022-12-29T14:53:00.100Z [err] npm ERR!
2022-12-29T14:53:00.100Z [err]  gyp info spawn args   '-I',
2022-12-29T14:53:00.100Z [err] npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
2022-12-29T14:53:00.100Z [err] npm ERR! gyp info spawn args   '-I',
2022-12-29T14:53:00.100Z [err] npm ERR! gyp info spawn args   '/usr/src/node-red/.cache/node-gyp/16.16.0/include/node/common.gypi',
2022-12-29T14:53:00.100Z [err] npm ERR!
2022-12-29T14:53:00.101Z [err]  gyp info spawn args   '-Dlibrary=shared_library',
2022-12-29T14:53:00.101Z [err] npm ERR! gyp info spawn args   '-Dvisibility=default',
2022-12-29T14:53:00.101Z [err] npm ERR!
2022-12-29T14:53:00.101Z [err]  gyp info spawn args   '-Dnode_root_dir=/usr/src/node-red/.cache/node-gyp/16.16.0',
2022-12-29T14:53:00.101Z [err] npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
2022-12-29T14:53:00.101Z [err] npm ERR!
2022-12-29T14:53:00.101Z [err]  gyp info spawn args   '-Dnode_lib_file=/usr/src/node-red/.cache/node-gyp/16.16.0/<(target_arch)/node.lib',
2022-12-29T14:53:00.101Z [err] npm ERR! gyp info spawn args   '-Dmodule_root_dir=/data/node_modules/@serialport/bindings',
2022-12-29T14:53:00.101Z [err] npm
2022-12-29T14:53:00.101Z [err]  ERR! gyp info spawn args   '-Dnode_engine=v8',
2022-12-29T14:53:00.101Z [err] npm ERR!
2022-12-29T14:53:00.101Z [err]  gyp info spawn args   '--depth=.',
2022-12-29T14:53:00.101Z [err] npm ERR! gyp info spawn args   '--no-parallel',
2022-12-29T14:53:00.101Z [err] npm ERR!
2022-12-29T14:53:00.101Z [err]  gyp info spawn args   '--generator-output',
2022-12-29T14:53:00.101Z [err] npm ERR! gyp info spawn args   'build',
2022-12-29T14:53:00.101Z [err] npm ERR! gyp info spawn args   '-Goutput_dir=.'
2022-12-29T14:53:00.101Z [err] npm ERR! gyp info spawn args ]
2022-12-29T14:53:00.101Z [err] npm ERR! gyp info spawn make
2022-12-29T14:53:00.101Z [err] npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
2022-12-29T14:53:00.101Z [err] npm ERR! make: printf: Operation not permitted
2022-12-29T14:53:00.101Z [err] npm ERR! make: *** [bindings.target.mk:116: Release/obj.target/bindings/src/serialport.o] Error 127
2022-12-29T14:53:00.101Z [err] npm ERR! gyp ERR! build error 
2022-12-29T14:53:00.101Z [err] npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
2022-12-29T14:53:00.101Z [err] npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
2022-12-29T14:53:00.101Z [err] npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
2022-12-29T14:53:00.101Z [err] npm ERR!
2022-12-29T14:53:00.102Z [err]  gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
2022-12-29T14:53:00.102Z [err] npm ERR! gyp ERR! System Linux 4.4.0-210-generic
2022-12-29T14:53:00.102Z [err] npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2022-12-29T14:53:00.102Z [err] npm ERR! gyp ERR! cwd /data/node_modules/@serialport/bindings
2022-12-29T14:53:00.102Z [err] npm
2022-12-29T14:53:00.102Z [err]  ERR! gyp ERR! node -v v16.16.0
2022-12-29T14:53:00.102Z [err] npm ERR! gyp ERR! node-gyp -v v9.0.0
2022-12-29T14:53:00.102Z [err] npm
2022-12-29T14:53:00.102Z [err]  ERR! gyp ERR! not ok
2022-12-29T14:53:00.105Z [err] 
2022-12-29T14:53:00.105Z [err] npm ERR!
2022-12-29T14:53:00.105Z [err]  A complete log of this run can be found in:
2022-12-29T14:53:00.105Z [err] npm ERR!     /data/.npm/_logs/2022-12-29T14_52_47_254Z-debug-0.log
2022-12-29T14:53:00.121Z rc=1
maxwellhadley commented 1 year ago

The trouble here is something to do with printf?!

2022-12-29T14:53:00.101Z [err] npm ERR! make: printf: Operation not permitted
2022-12-29T14:53:00.101Z [err] npm ERR! make: *** [bindings.target.mk:116: Release/obj.target/bindings/src/serialport.o] Error 127

I have no idea where this is coming from. I don't see it when installing. Something to do with Docker maybe?

Er-i-c commented 1 year ago

I got mine working after rebuilding @serialport: ~/.node-red/node_modules/@serialport$ npm rebuild rebuilt dependencies successfully

Thanks for the tip @Strixx76 !

Strixx76 commented 1 year ago

I have no idea where this is coming from. I don't see it when installing. Something to do with Docker maybe?

Well, yes and no I guess. The issue exists on all type of fresh installs on all types container installations. I have tried LXC containers as well now. Different errors but all is about missing dependencies because the need of building the serialport package.

It is not working in the Home Assistant Add-on or in Proxmox LXC Container built with tteck helper script or in the official Node-RED docker container

The only way I have got it up and running is by building my on container with Alpine Linux as base and install all dependencies for building the serialport package:

apk add --no-cache nodejs npm
apk add --no-cache make gcc g++ python3 linux-headers udev
npm install -g --unsafe-perm node-red

Or you have to start with an older Node-RED and node.js version and do updates and upgrades and manually rebuild the serialport package, but even then you need to have all build-essentials and python installed in the container.

I know absolutely nothing about how to create Node-RED nodes, but according to the maintainer of the Home Assistant add-on the problem is due to "improperly configured environment". In that Docker container there is already serialport installed.

maxwellhadley commented 5 months ago

Version 2.13.0 now published to npm uses serialport 11.x.x, to retain compatibility with NodeJS v14. If this is available ready-compiled, it should avoid the issue, perhaps?