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 v2.9.0 Cant install to Node Red V1 #86

Closed Cjdavidson closed 4 years ago

Cjdavidson commented 4 years ago

I would like to updated my Node Red to Version 1.0.2 but when i install Rfxcom v2.9.0 it say it needs recompiling. Its been fine on v20.8.

Can you help with this.

doomedsardines commented 4 years ago

Try deleting and reinstalling the node new, for me rfxcom working on ver 1.0.1 now

Cjdavidson commented 4 years ago

Ok Thanks will do.

Cjdavidson commented 4 years ago

Nope that did not work.

2019-10-20T16:29:50.238Z Install : node-red-contrib-rfxcom 2.9.0

2019-10-20T16:29:50.303Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-rfxcom@2.9.0
2019-10-20T16:30:04.678Z [out] 
2019-10-20T16:30:04.678Z [out] > serialport@6.2.2 install /config/node-red/node_modules/serialport
2019-10-20T16:30:04.678Z [out] > prebuild-install || node-gyp rebuild
2019-10-20T16:30:04.678Z [out] 
2019-10-20T16:30:05.529Z [err] prebuild-install
2019-10-20T16:30:05.529Z [err]  WARN install No prebuilt binaries found (target=10.16.3 runtime=node arch=x64 platform=linux)
2019-10-20T16:30:06.396Z [err] gyp
2019-10-20T16:30:06.397Z [err]  
2019-10-20T16:30:06.397Z [err] ERR!
2019-10-20T16:30:06.397Z [err]  build error
2019-10-20T16:30:06.397Z [err]  
2019-10-20T16:30:06.398Z [err] gyp
2019-10-20T16:30:06.398Z [err]  ERR!
2019-10-20T16:30:06.398Z [err]  stack
2019-10-20T16:30:06.398Z [err]  Error: not found: make
2019-10-20T16:30:06.398Z [err] gyp ERR!
2019-10-20T16:30:06.398Z [err]  stack
2019-10-20T16:30:06.398Z [err]      at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
2019-10-20T16:30:06.398Z [err] gyp
2019-10-20T16:30:06.398Z [err]  ERR!
2019-10-20T16:30:06.398Z [err]  stack
2019-10-20T16:30:06.398Z [err]      at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
2019-10-20T16:30:06.398Z [err] gyp
2019-10-20T16:30:06.398Z [err]  ERR!
2019-10-20T16:30:06.398Z [err]  stack
2019-10-20T16:30:06.398Z [err]      at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
2019-10-20T16:30:06.398Z [err] gyp
2019-10-20T16:30:06.398Z [err]  ERR! 
2019-10-20T16:30:06.398Z [err] stack     at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
2019-10-20T16:30:06.399Z [err] gyp 
2019-10-20T16:30:06.399Z [err] ERR! 
2019-10-20T16:30:06.399Z [err] stack     at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
2019-10-20T16:30:06.399Z [err] gyp ERR! 
2019-10-20T16:30:06.399Z [err] stack     at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
2019-10-20T16:30:06.399Z [err] gyp 
2019-10-20T16:30:06.399Z [err] ERR! 
2019-10-20T16:30:06.399Z [err] stack     at FSReqWrap.oncomplete (fs.js:153:21)
2019-10-20T16:30:06.399Z [err] gyp
2019-10-20T16:30:06.399Z [err]  ERR! 
2019-10-20T16:30:06.399Z [err] System Linux 4.15.0-65-generic
2019-10-20T16:30:06.400Z [err] gyp
2019-10-20T16:30:06.400Z [err]  ERR!
2019-10-20T16:30:06.400Z [err]  command
2019-10-20T16:30:06.400Z [err]  "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2019-10-20T16:30:06.400Z [err] gyp
2019-10-20T16:30:06.400Z [err]  ERR!
2019-10-20T16:30:06.400Z [err]  cwd /config/node-red/node_modules/serialport
2019-10-20T16:30:06.400Z [err] gyp
2019-10-20T16:30:06.400Z [err]  ERR!
2019-10-20T16:30:06.400Z [err]  node -v
2019-10-20T16:30:06.400Z [err]  v10.16.3
2019-10-20T16:30:06.400Z [err] gyp 
2019-10-20T16:30:06.400Z [err] ERR! 
2019-10-20T16:30:06.400Z [err] node-gyp -v v3.8.0
2019-10-20T16:30:06.400Z [err] gyp
2019-10-20T16:30:06.400Z [err]  ERR! 
2019-10-20T16:30:06.400Z [err] not ok 
2019-10-20T16:30:06.810Z [err] npm
2019-10-20T16:30:06.810Z [err]  ERR! code ELIFECYCLE
2019-10-20T16:30:06.810Z [err] npm 
2019-10-20T16:30:06.810Z [err] ERR! 
2019-10-20T16:30:06.810Z [err] errno 1
2019-10-20T16:30:06.812Z [err] npm
2019-10-20T16:30:06.812Z [err]  ERR!
2019-10-20T16:30:06.812Z [err]  serialport@6.2.2 install: `prebuild-install || node-gyp rebuild`
2019-10-20T16:30:06.812Z [err] npm 
2019-10-20T16:30:06.812Z [err] ERR! Exit status 1
2019-10-20T16:30:06.812Z [err] npm
2019-10-20T16:30:06.812Z [err]  ERR!
2019-10-20T16:30:06.812Z [err]  
2019-10-20T16:30:06.812Z [err] npm ERR!
2019-10-20T16:30:06.812Z [err]  Failed at the serialport@6.2.2 install script.
2019-10-20T16:30:06.812Z [err] npm
2019-10-20T16:30:06.812Z [err]  ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-10-20T16:30:06.859Z [err] 
2019-10-20T16:30:06.859Z [err] npm ERR! A complete log of this run can be found in:
2019-10-20T16:30:06.859Z [err] npm ERR!     /root/.npm/_logs/2019-10-20T16_30_06_840Z-debug.log
2019-10-20T16:30:06.871Z rc=1
maxwellhadley commented 4 years ago

As far as I can see, this is a problem with the NodeJS version, not the Node-RED version. I'm using an old version of serialport in the underlying node-rfxcom package, because later versions broke the functions I use to support dynamic unplugging & reconnecting, on the Windows platform. I think this is now fixed - at least a PR fixing the change has been accepted, but whether this has yet been published to npm I am unable to tell.

My development computer is in the process of being upgraded, which is proving problematic, and as I have been very busy lately it is taking a long time to sort out. Eventually, I will sort it though. At that point I will test the latest serialport and update the packages accordingly.

The error messages indicate that npm could not fine a pre-built binary of the serialport version appropriate to your architecture, and that it could not find the make command that gyp needs as the first step to compile the C++ source. Probably, you do not have the development tools isntalled on your computer, or just possibly the user running npm does not have permission to execute make.

Cjdavidson commented 4 years ago

Thank you for this great module. I guess I will have to wait until your dev machine is back up and running.

Thanks again

TheOriginalMrWolf commented 4 years ago

Hi,

I have the same problem.

Found that "npm i serialport@latest" works fine, but "npm i serialport@6.2.2" fails horribly as per the above.

Unfortunately, the install script for RFXcom specifies 6.2.2.

After a bit of digging, the following got me going:

npm i rfxcom@1.4.1 npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-rfxcom@2.6.3

Works (for now).

Hope that helps :)

Cjdavidson commented 4 years ago

Thank @TheOriginalMrWolf I will try this soon.

maxwellhadley commented 4 years ago

I'm working on it, but there are a lot of changes to the RFX firmware to catch up on as well. Please be patient a while longer!

Thanks

Cjdavidson commented 4 years ago

That’s Great news Thanks.

UweNB commented 4 years ago

Hello, Max,

take the time you need. Sure you can do it! Thank you for your efforts!

maxwellhadley commented 4 years ago

I have now published node-rfxcom version 2.1.0 which should fix this issue without, if you run npm update node-rfxcom or reinstall the node

UweNB commented 4 years ago

Hi Max,

I just tried it with the current Node-Red version and it was easy to install!

Thanks for your hard work!

Cjdavidson commented 4 years ago

Hi Max I cant see the update in the Node Red manage palette. Is it because its 2.1.0 and the current one is 2.9.0.

Edit Just tried to install on Node Red v1.0.3 Again and wont install. Sorry..

maxwellhadley commented 4 years ago

This in an update to the node-rfxcom package, not node-red-contrib-rfxcom. You need to run npm update node-rfxcomfrom the node-red-contrib-rfxcom install directory, or it may be simpler just to remove & reinstall node-red-contrib-rfxcom.

Cjdavidson commented 4 years ago

Not sure how to remove node-red-contrib-rfxcom when i have it inuse.

bigfreak85 commented 4 years ago

@maxwellhadley today you are my Hero thx a lot.

UweNB commented 4 years ago

Hello,

installation went great. But it does not return any values in the debug window. Is this a bug or am I doing something wrong? Thanks!

maxwellhadley commented 4 years ago

For those with installation issues, please try updating to the latest 2.9.1 version. This fixes a couple of minor bugs and should force the dependencies to be updated as well.

maxwellhadley commented 4 years ago

@UweNB I'm not sure what you mean - if you use a debug node you should see the contents of received messages: if you check the 'Show debug messages on the console' box on the config node properties dialog you should get the hexadecimal dump of the received data. I haven't changed either of these, and they work for me!

Cjdavidson commented 4 years ago

Sorry Max I updated to 2.9.1 and then tried to upgrade to v1.0.3 of Node red and got the same error.

> node-red-docker@1.0.3 start /usr/src/node-red,
> node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data",
27 Dec 07:49:22 - [warn] ------------------------------------------------------,
27 Dec 07:49:22 - [warn] [ttb-node-red-counter/counter] Type already registered,
27 Dec 07:49:22 - [warn] [node-red-node-serialport/serialport] Error: The module '/data/node_modules/@serialport/bindings/build/Release/bindings.node',
NODE_MODULE_VERSION 57. This version of Node.js requires,
was compiled against a different Node.js version using,
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing,
the module (for instance, using `npm rebuild` or `npm install`).,
27 Dec 07:49:22 - [warn] [node-red-contrib-rfxcom/rfxcom] Error: Module did not self-register.
maxwellhadley commented 4 years ago

Are you using a docker install of Node-RED? The underlying problem is that the pre-compiled 'bindings' used by Serialport have been compiled against a different, older version of NodeJS. It may be that npm is getting confused because the version of NodeJS 'inside' the Docker container is different from that 'outside', and is wrongly requesting the older version. I haven't ever used Docker myself and I can't really advise what best to do.

There have been a few messages on the Node-RED forum about similar issues - for example https://discourse.nodered.org/t/unable-to-start-node-red-windows/16315. Maybe have a look there, or ask on the forum. There are certainly people around who do use Docker regularly & may spot the problem immediately

It's odd that the initial warning of incompatible version types comes from node-red-node-serialport, not node-red-contrib-rfxcom. Are you using the serialport node anywhere? It isn't used by rfxcom. (Although you would probably get the same sort of error from node-red-contrib-rfxcom.)

Cjdavidson commented 4 years ago

Well i tried loads of ways to sort this in the end i deleted the node-red folder and luckly i had used node red projects to github. so i cloned it back and all's well with the node red v1.0.3 and Rfxcom v2.9.1.

Thanks for your help