1

I have used the node-red-contrib-rfm69radio 1.0.1 node for years now on an RPi running with Raspi OS 32 bit. Since the OS is outdated, I made a fresh install of Raspi OS64bit, installed node-red and then tried to install the node-red-contrib-rfm69radio.

It fails, no matter if i do it from the palette menu or in a terminal. What I get is the error below. I have searched everywhere, but it seems no one else has had this problem. I have also tried installing pigpio, spi-device, and onoff beforehand (all work), but this didn't solve the problem. The last thing I did was installing without dependencies, from: Install npm package without dependencies

However, also this didn't solve the problem. I'm totally stuck now. Does anybody have an idea how to solve this? Or is the package simply outdated (nearly 4 years old) and won't work with current versions (64bit, npm, node.js)?

I need the RFM69Radio messages (at least receiving) to get data from several Moteinos to the RPi.

Thanks & cheers, Martin

<pre><code>
martin@raspberrypi:~ $ npm -g install node-red-contrib-rfm69radio
npm ERR! code 1
npm ERR! path /home/martin/.config/nvm/versions/node/v16.17.1/lib/node_modules/node-red-contrib-rfm69radio/node_modules/spi-device
npm ERR! command failed
npm ERR! command sh /tmp/install-1c43cb4b.sh
npm ERR! make: Verzeichnis „/home/martin/.config/nvm/versions/node/v16.17.1/lib/node_modules/node-red-contrib-rfm69radio/node_modules/spi-device/build“ wird betreten
npm ERR!   CXX(target) Release/obj.target/spi/src/spi.o
npm ERR!   CXX(target) Release/obj.target/spi/src/spidevice.o
npm ERR!   CXX(target) Release/obj.target/spi/src/open.o
npm ERR!   CXX(target) Release/obj.target/spi/src/close.o
npm ERR!   CXX(target) Release/obj.target/spi/src/transfer.o
npm ERR!   CXX(target) Release/obj.target/spi/src/getoptions.o
npm ERR! make: Verzeichnis „/home/martin/.config/nvm/versions/node/v16.17.1/lib/node_modules/node-red-contrib-rfm69radio/node_modules/spi-device/build“ wird verlassen
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@16.17.1 | linux | arm64
npm ERR! gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/martin/.config/nvm/versions/node/v16.17.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/martin/.config/nvm/versions/node/v16.17.1/lib/node_modules/node-red-contrib-rfm69radio/node_modules/spi-device/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/martin/.config/nvm/versions/node/v16.17.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/martin/.cache/node-gyp/16.17.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/martin/.cache/node-gyp/16.17.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/martin/.config/nvm/versions/node/v16.17.1/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/martin/.cache/node-gyp/16.17.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/martin/.config/nvm/versions/node/v16.17.1/lib/node_modules/node-red-contrib-rfm69radio/node_modules/spi-device',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../../nan/nan.h:294,
npm ERR!                  from ../src/getoptions.cc:4:
npm ERR! ../../nan/nan_new.h: In instantiation of ‘typename Nan::imp::Factory<T>::return_t Nan::New(A0) [with T = v8::Uint32; A0 = long unsigned int; typename Nan::imp::Factory<T>::return_t = v8::Local<v8::Uint32>]’:
npm ERR! ../src/getoptions.cc:35:65:   required from here
npm ERR! ../../nan/nan_new.h:208:30: error: call of overloaded ‘New(long unsigned int&)’ is ambiguous
npm ERR!   208 |   return imp::Factory<T>::New(arg0);
npm ERR!       |          ~~~~~~~~~~~~~~~~~~~~^~~~~~
npm ERR! In file included from ../../nan/nan_new.h:189,
npm ERR!                  from ../../nan/nan.h:294,
npm ERR!                  from ../src/getoptions.cc:4:
npm ERR! ../../nan/nan_implementation_12_inl.h:177:1: note: candidate: ‘static Nan::imp::FactoryBase<v8::Uint32>::return_t Nan::imp::Factory<v8::Uint32>::New(int32_t)’
npm ERR!   177 | Factory<v8::Uint32>::New(int32_t value) {
npm ERR!       | ^~~~~~~~~~~~~~~~~~~
npm ERR! ../../nan/nan_implementation_12_inl.h:183:1: note: candidate: ‘static Nan::imp::FactoryBase<v8::Uint32>::return_t Nan::imp::Factory<v8::Uint32>::New(uint32_t)’
npm ERR!   183 | Factory<v8::Uint32>::New(uint32_t value) {
npm ERR!       | ^~~~~~~~~~~~~~~~~~~
npm ERR! make: *** [spi.target.mk:121: Release/obj.target/spi/src/getoptions.o] Fehler 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/home/martin/.config/nvm/versions/node/v16.17.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.15.61-v8+
npm ERR! gyp ERR! command "/home/martin/.config/nvm/versions/node/v16.17.1/bin/node" "/home/martin/.config/nvm/versions/node/v16.17.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/martin/.config/nvm/versions/node/v16.17.1/lib/node_modules/node-red-contrib-rfm69radio/node_modules/spi-device
npm ERR! gyp ERR! node -v v16.17.1
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/martin/.npm/_logs/2022-09-30T09_22_01_344Z-debug-0.log
</pre><code>
hardillb
  • 54,545
  • 11
  • 67
  • 105
martin_pi
  • 11
  • 2

2 Answers2

0

This looks like it's a chain dependency problem

node-red-contrib-rfm69radio depends on rfm69radio version 4.0.x

rfm69radio depends on spi-device 2.0.x

The latest version of spi-device is 3.1.2 which has a number of fixes which are probably related to the problem.

The problem is you will need to get the maintainer of rfm69radio to update their dependency (which is major version number change so could involve breaking API changes) to the new version of spi-device, and then get the developer of node-red-contrib-rfm69radio to update to the new version of rfm69radio

You can test if this will solve the problem by creating a temporary directory and inside that directory run the following:

npm install spi-device@3.1.2

If this completes cleanly then the you will know if you are on the right track.

hardillb
  • 54,545
  • 11
  • 67
  • 105
  • Thanks, that was fast and helps in so far, that I don't have to try out anything else! I've tried the command and here is was I got: npm install spi-device@3.1.2 removed 1 package, and audited 89 packages in 3s 3 packages are looking for funding run `npm fund` for details 7 vulnerabilities (6 moderate, 1 critical) To address issues that do not require attention, run: npm audit fix To address all issues (including breaking changes), run: npm audit fix --force – martin_pi Sep 30 '22 at 11:15
  • That implies the 3.1.2 fixes the problem as the install looks to completed cleanly – hardillb Sep 30 '22 at 11:23
  • Did I understand correctly, that indeed now the only thing I can do is contact the module programmer? Luckily it is only one and the same for both modules. Thank you very much for your kind help! – martin_pi Sep 30 '22 at 11:50
  • You can raise issues against the 2 projects on github (links to github are on the npm pages, suggest you link to this question when you do). But unfortunately neither of those projects have been updated in while, so there is no guarantee that the authors are still interested in fixing them, but it's always worth a try. – hardillb Sep 30 '22 at 11:58
  • Done! Let's see if Andy will answer. At least he still is active on Github.Thank you very much! – martin_pi Sep 30 '22 at 12:13
0

I have now created a fork of rfm69radio on github as user mapigit and updated the package.json with the current versions of onoff and spi-device. No other chages were necessary. With these changes, rfm69radio can be installed, and after that the rfm69radio-node. This works even with the Raspberry Pi 64bit OS, I've just tried.

Update October 4th 2022: Andy Fleming has just merged the changes into his repo, so everything should be fine now.

Cheers, Martin

martin_pi
  • 11
  • 2