Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gargamelonly opened this issue Apr 27, 2020 · 12 comments

Comments

@gargamelonly
Copy link

[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
Copy link

What version of homebridge are you running?

@gargamelonly
Copy link
Author

1.0.1

@bushshrub
Copy link

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

@dewoert
Copy link

dewoert commented Apr 30, 2020

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
Copy link
Author

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

@bencharlesrhys
Copy link

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
Copy link
Author

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.

@gargamelonly gargamelonly changed the title Homebridge container, error loading plugin, Cannot find module 'hap-nodejs' error loading plugin, Cannot find module 'hap-nodejs' with Homebridge V1.0 and up - fixed in Defensor7 fork May 9, 2020
@bencharlesrhys
Copy link

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

@Ant1q
Copy link

Ant1q commented May 10, 2020

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
Copy link

ffaamm commented May 11, 2020

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
Copy link

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
Copy link

bencharlesrhys commented May 13, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants