Openhabian 2.2 - installation node-red-contrib-homekit

HI, I am using openhabian 2.2 (updated from 2.1)

I’d like to make use of the homekit contribution for node-red, but I always fail to install it. Last result was using “sudo npm install -g node-red-contrib-homekit --unsafe-perm”.

But this ends in an error:

515 verbose lifecycle mdns@2.3.4~install: unsafe-perm in lifecycle true
516 verbose lifecycle mdns@2.3.4~install: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/lib/node_modules/node-red-contrib-homekit/node_modules/mdns/node_modules/.bin:/usr/lib/node_modules/node-red-contrib-homekit/node_modules/.bin:/usr/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
517 verbose lifecycle mdns@2.3.4~install: CWD: /usr/lib/node_modules/node-red-contrib-homekit/node_modules/mdns
518 silly lifecycle mdns@2.3.4~install: Args: [ '-c', 'node-gyp rebuild' ]
519 silly lifecycle mdns@2.3.4~install: Returned: code: 1  signal: null
520 info lifecycle mdns@2.3.4~install: Failed to exec install script
521 verbose unlock done using /root/.npm/_locks/staging-a072192f34a17023.lock for /usr/lib/node_modules/.staging
522 verbose stack Error: mdns@2.3.4 install: `node-gyp rebuild`
522 verbose stack Exit status 1
522 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
522 verbose stack     at emitTwo (events.js:106:13)
522 verbose stack     at EventEmitter.emit (events.js:194:7)
522 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
522 verbose stack     at emitTwo (events.js:106:13)
522 verbose stack     at ChildProcess.emit (events.js:194:7)
522 verbose stack     at maybeClose (internal/child_process.js:899:16)
522 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
523 verbose pkgid mdns@2.3.4
524 verbose cwd /usr/lib/node_modules
525 verbose Linux 4.9.35-v7+
526 verbose argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "node-red-contrib-homekit" "--unsafe-perm"
527 verbose node v7.10.1
528 verbose npm  v5.6.0
529 error code ELIFECYCLE
530 error errno 1
531 error mdns@2.3.4 install: `node-gyp rebuild`
531 error Exit status 1
532 error Failed at the mdns@2.3.4 install script.
532 error This is probably not a problem with npm. There is likely additional logging output above.
533 verbose exit [ 1, true ]

Any ideas how to solve this?

Regards, Markus

playing with permissions I managed to start installation als openhabian with the following result: recipe for target 'Release/' failed
make: *** [Release/] Error 1
make: Leaving directory '/usr/lib/node_modules/node-red-contrib-homekit/node_modules/mdns/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.9.35-v7+
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/node-red-contrib-homekit/node_modules/mdns
gyp ERR! node -v v7.10.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! errno 1
npm ERR! mdns@2.3.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mdns@2.3.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/openhabian/.npm/_logs/2017-12-29T14_15_23_152Z-debug.log

I also tried to “reinstall” the needed packages:

[15:15:24] openhabian@servicebitch:/usr/lib$ sudo apt-get install libavahi-compat-libdnssd-dev
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
libavahi-compat-libdnssd-dev ist schon die neueste Version.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 2 nicht aktualisiert.
[15:17:26] openhabian@servicebitch:/usr/lib$


[15:17:26] openhabian@servicebitch:/usr/lib$ node -v
[15:32:48] openhabian@servicebitch:/usr/lib$ npm -v

After updating node.js to 9.3.0 and npm 5.6.0, still the same behaviour …

Now I still get errors that seem to have an issue with encoding or anything like that.


Have you solved the package install problem? I was trying to install some additional packages and had failures also.

I may have figured mine out, i used

sudo npm install -g --unsafe-perm node-red-contrib-homekit

Hi, no, I could not solve it. After having a full system crash, I switched back to pure homebridge. Works fine at the moment. I’ll have a new look at this topic, when the new taxonomy-model and so the new homekit-interface will be available.

In case you’re still looking for the solution to this - I installed the HomeKit flow from inside of node-red. Just navigate to your node red screen, click the hamburger menu in the top right, and choose “manage palette” and on that screen you will see the flows you have installed and an option to install new ones.

No permissions, no sudo, and no errors for me.