lprhodes / homebridge-broadlink-rm

Broadlink RM Mini and Pro plugin for homebridge: https://github.com/nfarina/homebridge
Apache License 2.0
570 stars 285 forks source link

error loading plugin, Cannot find module 'hap-nodejs' with Homebridge V1.0 and up - fixed in Defensor7 fork #614

Open gargamelonly opened 4 years ago

gargamelonly commented 4 years ago
[4/27/2020, 12:15:38 PM] ERROR LOADING PLUGIN homebridge-broadlink-rm:
[4/27/2020, 12:15:39 PM] Error: Cannot find module 'hap-nodejs'
Require stack:
- /homebridge/node_modules/homebridge-broadlink-rm/node_modules/homebridge-platform-helper/dist/accessory.js
- /homebridge/node_modules/homebridge-broadlink-rm/node_modules/homebridge-platform-helper/dist/index.js
- /homebridge/node_modules/homebridge-broadlink-rm/platform.js
- /homebridge/node_modules/homebridge-broadlink-rm/index.js
- /usr/local/lib/node_modules/homebridge/lib/plugin.js
- /usr/local/lib/node_modules/homebridge/lib/pluginManager.js
- /usr/local/lib/node_modules/homebridge/lib/api.js
- /usr/local/lib/node_modules/homebridge/lib/index.js
- /usr/local/lib/node_modules/homebridge/lib/cli.js
- /usr/local/lib/node_modules/homebridge/bin/homebridge
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
    at Function.Module._load (internal/modules/cjs/loader.js:862:27)
    at Module.require (internal/modules/cjs/loader.js:1042:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/homebridge/node_modules/homebridge-broadlink-rm/node_modules/homebridge-platform-helper/src/accessory.ts:3:1)
    at Module._compile (internal/modules/cjs/loader.js:1156:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1042:19)
[4/27/2020, 12:15:39 PM] ====================
bushshrub commented 4 years ago

What version of homebridge are you running?

gargamelonly commented 4 years ago

1.0.1

bushshrub commented 4 years ago

If I'm correct, this plugin hasn't been updated to Homebridge v1. Try rolling homebridge back to the previous version.

dewoert commented 4 years ago

Problem is since v3.6.20 (or so), and also in older HomeBridge versions. I'm running HomeBridge 1.0.4 without problems, but with older version of homebridge-broadlink-rm (3.6.18)

npm remove homebridge-broadlink-rm npm install -save homebridge-broadlink-rm@v3.6.18

Tries serveral solutions, none seem to work. Plugin needs te be reviewed and updated.

gargamelonly commented 4 years ago

It feels like this plugin has been abandoned by the creator.

bencharlesrhys commented 4 years ago

Problem is since v3.6.20 (or so), and also in older HomeBridge versions. I'm running HomeBridge 1.0.4 without problems, but with older version of homebridge-broadlink-rm (3.6.18)

npm remove homebridge-broadlink-rm npm install -save homebridge-broadlink-rm@v3.6.18

Tries serveral solutions, none seem to work. Plugin needs te be reviewed and updated.

Thank you this fixed the issue for me.

gargamelonly commented 4 years ago

I installed Defensor7/homebridge-broadlink-rm plugin which is a fork of this one and it is working also with RM3mini. He fixed it in his fork.

bencharlesrhys commented 4 years ago

It doesn't look like it's in npm. How can I install the forked version?

Ant1q commented 4 years ago

It doesn't look like it's in npm. How can I install the forked version?

it looks like subject fork https://www.npmjs.com/package/homebridge-broadlink-rm4

ffaamm commented 4 years ago

I too just runned into this problem, it seems solved by manually installing hap-nodejs. npm install -g hap-nodejs

Some references: node -v v12.16.3 npm -v 6.14.5 homebridge v1.0.4 homebridge-config-ui-x v4.18.0

SSutherland94 commented 4 years ago

I installed Defensor7/homebridge-broadlink-rm plugin which is a fork of this one and it is working also with RM3mini. He fixed it in his fork.

I'm still having trouble with the Defensor fork. I honestly have no idea what I'm doing wrong. The plugin isn't detecting my device, and when I input the IP and MAC manually, I still get hit with "Device not found". I have an RM Mini3, and I think the PID, according to the Broadlink app, is 3727. I also tried the homebridge-broadlink-rm-tv plugin to no avail. And help would be greatly appreciated. I have everything else running buttery smooth in Homebridge except this.

bencharlesrhys commented 4 years ago

I too just runned into this problem, it seems solved by manually installing hap-nodejs. npm install -g hap-nodejs

Some references: node -v v12.16.3 npm -v 6.14.5 homebridge v1.0.4 homebridge-config-ui-x v4.18.0

I tried your suggestion but didn't work. Then I removed the global and it worked!

npm install hap-nodejs

Using the oznu DSM Synology container.