maxwellhadley / node-red-contrib-rfxcom

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

Won't install on Mac #97

Closed svwhisper closed 4 years ago

svwhisper commented 4 years ago

Please consider removing the dependency on abstract-socket, which apparently only supports linux. Attempting to install your node on a Mac using the palette results in errors due to this lack of Mac support by abstract-socket. I suspect this will be a lot of work, but thought I would ask anyway.

I'm running node v12.18.2 and MacOS Catalina with node-red v1.1.0.

dave

Also tried "npm install abstract-socket" and got:

npm ERR! notsup Unsupported platform for abstract-socket@2.1.1: wanted {"os":"linux","arch":"any"} (current: {"os":"darwin","arch":"x64"}) npm ERR! notsup Valid OS: linux npm ERR! notsup Valid Arch: any npm ERR! notsup Actual OS: darwin npm ERR! notsup Actual Arch: x64

maxwellhadley commented 4 years ago

There is no dependency on abstract-socket in the packages I maintain, though it is possible serialport or queue might pull it in. I do almost all my development on Macs, currently Mojave, and I have never come across this issue before.

I created an empty directory and ran npm install node-red-contrib-rfxcom from within it. This completed without error (except for complaining about the missing package.json). Possibly the issue lies with installing from the palette - can you please try creating an empty directory & installing from the command line like I did, and let me know what happens?

svwhisper commented 4 years ago

The installation was successful using npm. When trying to install via the pallet (which invokes this: npm install --no-audit --no-update-notifier --no-fund --save --save-prefix="~" --production node-red-contrib-rfxcom@2.11.0

The exact command in a shell runs fine. From within the pallet, the logs show this:

2020-07-08T23:19:21.678Z [err] WARN registry Using stale data from https://registry.npmjs.org/ because the host is inaccessible -- are you offline?

I can ping registry.npmjs.org from a shell on the Mac, but apparently node-red has trouble. This is looking like a node-red configuration issue rather than an issue with your package, but do you perhaps have any thoughts on this? If not, I'll take this over to the node-red forum.

edit: What's really odd is that if I add registry.npmjs.org to my hosts file and re-run the install, it errors when name resolution fails on another host. It appears that node-red pallet is unable to resolve hostnames. Again, npm in a shell works fine.

Thanks

maxwellhadley commented 4 years ago

I have never tried installing nodes from the palette, so I can't help much! One thought - what user is your nodeRED running as? If it is not your normal user, try su'ing to that user and see if the command line fails. Otherwise raise your problem on the forum, and feel free to link to this issue.

svwhisper commented 4 years ago

It's now working. I:

used nvm to install latest LTS version of node (12.18.2) npm rebuild fixed xcode tools (Catalina issue) npm rebuild installed the rfxcomm node using the pallet

all good.

maxwellhadley commented 4 years ago

If in doubt, turn it off and on again!