homebridge-apple-tv: Cannot install Error: sodium@2.0.3

I was trying to get this plugin installed on my home bridge docker, but I am hitting some issues with installing sodium. I am using the oznu home bridge docker and this is my startup.sh

apk add libtool
apk add autoconf
apk add automake
apk add libsodium
apk add g++
npm rebuild
verbose stack Error: sodium@2.0.3 install: `node install.js --install`
verbose stack Exit status 1
verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
verbose stack     at EventEmitter.emit (events.js:182:13)
verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
verbose stack     at ChildProcess.emit (events.js:182:13)
verbose stack     at maybeClose (internal/child_process.js:962:16)
verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
verbose pkgid sodium@2.0.3
verbose cwd /homebridge
verbose Linux 4.18.17-unRAID
verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "homebridge-apple-tv" "--unsafe-perm"
verbose node v10.13.0
verbose npm  v6.4.1
error code ELIFECYCLE
error errno 1
error sodium@2.0.3 install: `node install.js --install`
error Exit status 1
error Failed at the sodium@2.0.3 install script.
error This is probably not a problem with npm. There is likely additional logging output above.
6656 verbose exit [ 1, true ]

About this issue

Most upvoted comments

My change in pponce/homebridge-apple-tv was to make homebridge-apple-tv depend on a fork of node-appletv (https://github.com/socalrds/node-appletv). That forked version of node-appletv updates its dependency to sodium 3.0.1 which in theory solves the build issue with sodium version 2.0.3. I’m running on an rpi 3 with LTS 10.14.2 version of node js.

After you received this error: Static libsodium was not found at /root/.npm/_cacache/tmp/git-clone-77f03c40/node_modules/sodium/deps/build/lib/libsodium so compiling libsodium from source. Was it able to compile libsodium from source?

Can you try apt-get install autoconf automake g++ libtool prior to installing pponce/homebridge-apple-tv

@dornadeluxe Can you find where the homebridge-appletv plugin was installed? In my case it’s installed in: /home/pi/.nvm/versions/node/v10.14.2/lib/node_modules/homebridge-apple-tv

If you navigate to where it was installed and then run: cd node_modules/node-appletv/bin

You should then be able to run the pair command by executing this command ./appletv pair

You should see two apple tv’s appear. Select the second one in the list to pair with. Follow instructions and copy the full key that is returned as you will need it to update your config.js for the homebridge-appletv plugin. Also add “showPairSwitches”: false in the config.json for this plugin.

You should then be paired already and the plugin should auto find your Apple TV still. That solved my issues.

I have the same problem on my Banana PI M2 Berry with Raspbian Strech. So far, haven’t found a solution. `/usr/local/lib/node_modules/homebridge-apple-tv/node_modules/sodium/install.js:287 throw new Error(cmdLine + ’ exited with code ’ + code); ^

Error: make nodesodium exited with code null at ChildProcess.<anonymous> (/usr/local/lib/node_modules/homebridge-apple-tv/node_modules/sodium/install.js:287:19) at ChildProcess.emit (events.js:182:13) at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! sodium@2.0.3 install: node install.js --install npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sodium@2.0.3 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! /root/.npm/_logs/2018-11-26T20_19_37_007Z-debug.log`