steilerDev / homebridge-openhab2-complete

A homebridge plugin for openHAB, that has the expectation to fully support all Services offered by Apple's Homekit Accessory Protocol (HAP)
GNU General Public License v3.0
52 stars 16 forks source link

Different Node versions needed for Homebridge vs. OpenHAB2 Complete #6

Closed RFila closed 5 years ago

RFila commented 5 years ago

I'm experiencing a conflict between the Node versions required by Homebridge and that required by OpenHab2-Complete. I followed the directions for getting homebridge up and running which included using Node 8.10.0. which brought up HomeBridge just fine. But once I installed OpenHab2-Complete, It would initialize, but include the following error when running Homebrige without a fully configure config.json:

Plugin /usr/lib/node_modules/homebridge-openhab2-complete requires Node version of >=10.15.0 which does not satisfy the current Node version of v8.10.0. You may need to upgrade your installation of Node.

So upon upgrading to Node 10.15.0, I tried loading HomeBridge and would get the following:

/usr/lib/node_modules/homebridge/node_modules/bindings/bindings.js:91 throw e ^

Error: The module '/usr/lib/node_modules/homebridge/node_modules/ed25519-hap/build/Release/ed25519.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 57. This version of Node.js requires NODE_MODULE_VERSION 64. Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install). at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at bindings (/usr/lib/node_modules/homebridge/node_modules/bindings/bindings.js:84:48) at Object. (/usr/lib/node_modules/homebridge/node_modules/ed25519-hap/index.js:1:99) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)

I attempted to rebuild, uninstall, and reinstall - following all the directions associated with getting homebridge to run with later node versions, but to no avail.

I pressed on wondering if maybe it was just a warning and things would work, but when I configured up my config.json, but this is the error I started receiving.

[2019-2-9 23:02:10] Plugin /usr/lib/node_modules/homebridge-openhab2-complete requires Node version of >=10.15.0 which does not satisfy the current Node version of v8.10.0. You may need to upgrade your installation of Node. [2019-2-9 23:02:12] Loaded plugin: homebridge-openhab2-complete [2019-2-9 23:02:12] Registering platform 'homebridge-openhab2-complete.openHAB2-Complete' [2019-2-9 23:02:12] --- [2019-2-9 23:02:12] Loading 1 platforms... [2019-2-9 23:02:12] [openHAB2-Complete] Initializing openHAB2-Complete platform... [2019-2-9 23:02:12] [openHAB2-Complete] Loading accessory types... /usr/lib/node_modules/homebridge-openhab2-complete/index.js:44 if(accessoryFile.isFile()) { ^

TypeError: accessoryFile.isFile is not a function at OpenHABComplete. (/usr/lib/node_modules/homebridge-openhab2-complete/index.js:44:30) at Array.forEach () at new OpenHABComplete (/usr/lib/node_modules/homebridge-openhab2-complete/index.js:43:24) at Server._loadPlatforms (/usr/lib/node_modules/homebridge/lib/server.js:326:32) at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:86:36) at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:45:10) at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32)

All this to say - how in the heck are you running Homebridge with your OpenHab2-Complete with two different Node versions - or have you cracked this nut somehow?

Thanks a ton - I am really interested in getting all the functionality of this plugin since I have Insteon Fans which your plug in seem to be the only one that allows all the extra support for.

Rob Fila

Configurations Please paste the configuration of:

Items: Dimmer Rob_Office_Lamp "Rob's Office Lamp" {insteonplm="XX.XX.XX:F00.00.19#dimmer"}

Environment (please complete the following information):

steilerDev commented 5 years ago

That is very weird. I added the dependency of 10.15.0, because that is the node version I'm running on my machine and I did not wanted to have check the APIs I'm using against their support for earlier node versions. I will try and check if my plugin also works with older node versions and decrease the required version if possible.

I am using the docker version of Homebridge in dev and prod. Maybe you can try setting up the docker?

Do you have any other plugins installed that might create a versioning conflict?

svenwiegand commented 5 years ago

I‘ve got the same error like @RFila but was in the end able to startup homebridge with this add-in successfully on Node 11.8.0.

I simply needed to reinstall homebridge and the plugin after updating node using these two commands (on raspberrypi with openhabian):

sudo npm install -g --unsafe-perm homebridge
sudo npm install -g --unsafe-perm homebridge-openhab2-complete

Afterwards a reboot was required before stuff worked.

RFila commented 5 years ago

I will give these options a try this evening. I'm not running any other plug-ins. The only one I'm trying is OpenHab2-Complete because it would provide all the functionality I need if I can get it running.

Thanks for the quick feedback.

steilerDev commented 5 years ago

Great, please let me know about your progress!

RFila commented 5 years ago

Okay - Had no luck trying the Node 11.8.0 on my primary install, but luckily, using the Docker installation method, I was able to get it to work. You might want to add that to your base instructions because like I said in my first post, most people hadn't been able to get the original HomeBridge to run with any version of Node above 8.10.0 which lead to my question.

I've got a few other questions now that've I've got it running but I'll start a new thread for those - Thanks so much fore your help.

steilerDev commented 5 years ago

Thanks! I added the note about my docker installation in the readme :)