Open justinrhodes opened 5 years ago
I ran into the same problem on Ubuntu 18.0.3. The 2.0.3 dependency come from a dependency of this project which is node-apple-tv. I have not figured out a workaround.
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.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`
same problem here
Maybe @lprhodes can give some advice on this one.
I know the issue lies with trying to install node-apple-tv plugin to Homebridge, so maybe I can create an issue there as well. I was trying to troubleshoot this past weekend, but just kept seeing the same error with multiple "fix attempts"
Based on the logs, I'm guessing something is going on with the directories it is looking for in node_modules
8623 warn rollback Rolling back sodium@2.0.3 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/homebridge/node_modules/node-appletv/node_modules/sodium'
8624 warn rollback Rolling back homebridge-apple-tv@1.0.2 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/homebridge/node_modules/homebridge-apple-tv/node_modules/homebridge-platform-helper'
8625 warn rollback Rolling back node-appletv@1.0.10 failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/homebridge/node_modules/node-appletv/node_modules/sodium'
Is the developer still active? Or did anyone else achieve any progress?
Does not look like he has been active for a few months :(
I'll try to dig in deeper and figure out what is going on. If anyone else figures this out, please share.
Same issue here.
Same for me, can't install
try pponce/homebridge-apple-tv
try pponce/homebridge-apple-tv
Tried to install from this package, got the same problem with for bot global and local types of installation:
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.
Same here on a Synology NAS (node.js v10.13)...
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
try pponce/homebridge-apple-tv
Sorry, I'm new, how do i specifically install from pponce/? All the homebridge plugins I've installed so far I use npm install -f <plugin-name>
, so how do I install this one? Thanks.
npm install -g git+https://git@github.com/pponce/homebridge-apple-tv.git but i think this should work as well npm install -g pponce/homebridge-apple-tv
sorry but I only use docker command line (via sh command). if I write "sudo apt-get install libtool"... I only get "sh : sudo: not found"... As you can see I am new to this world...
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
Thanks a lot, got it installed like that. Now I ran into the next problem however. :) My apple-tv is discovered twice which is also an open issue here. Tried to add it manually but for this I need to install node-appletv which again wants to install Sodium 2.0.3...
@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.
Another step further, thanks a lot pponce! I ran the pair process and copied the credentials and put everything in the config.js. So far so good but homebridge still is not willing to start. This is what I get now:
Dec 23 23:25:07 bpi-iot-ros-ai homebridge[3875]: [12/23/2018, 11:25:07 PM] [Apple TV] [INFO] Discovered Apple TV (AppleTV) at 192.168.1.221 Dec 23 23:25:07 bpi-iot-ros-ai homebridge[3875]: [12/23/2018, 11:25:07 PM] [Apple TV] [INFO] Discovered Apple TV (AppleTV) at 192.168.1.221 Dec 23 23:25:07 bpi-iot-ros-ai homebridge[3875]: [12/23/2018, 11:25:07 PM] [Apple TV] [INFO] Connecting to "Lounge Apple TV" Dec 23 23:25:07 bpi-iot-ros-ai homebridge[3875]: /usr/local/lib/node_modules/homebridge-apple-tv/node_modules/mdns/lib/resolver_sequence_tasks.js:19 Dec 23 23:25:07 bpi-iot-ros-ai homebridge[3875]: var error = dns_sd.buildException(errorCode); Dec 23 23:25:07 bpi-iot-ros-ai homebridge[3875]: ^ Dec 23 23:25:07 bpi-iot-ros-ai homebridge[3875]: Error: dns service error: unknown Dec 23 23:25:07 bpi-iot-ros-ai homebridge[3875]: at MDNSService.on_resolver_done (/usr/local/lib/node_modules/homebridge-apple-tv/node_modules/mdns/lib/resolver_sequence_tasks.js:19:30) Dec 23 23:25:07 bpi-iot-ros-ai homebridge[3875]: at SocketWatcher.MDNSService.self.watcher.callback (/usr/local/lib/node_modules/homebridge-apple-tv/node_modules/mdns/lib/mdns_service.js:18:40) Dec 23 23:25:07 bpi-iot-ros-ai homebridge[3875]: Disconnected Apple TV's Dec 23 23:25:07 bpi-iot-ros-ai systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE Dec 23 23:25:07 bpi-iot-ros-ai systemd[1]: homebridge.service: Unit entered failed state. Dec 23 23:25:07 bpi-iot-ros-ai systemd[1]: homebridge.service: Failed with result 'exit-code'.
I deleted the accessories folder and tried again and now it works, hallelujah! :) Thanks for your help and Merry Christmas!
Glad you figured that last one out. I was stumped.. Merry Christmas!
@dornadeluxe Hi there,
I had the same issue with "./accessories" module. As you did, I deleted the accessories folder.
That didn't help. Here's what I did:
I checked the original repo, folder "accessories". I manually created all 4 .js files on the same folder on my raspberry and copied the code from original repo. It worked for me. Now works perfectly.
npm install -g git+https://git@github.com/pponce/homebridge-apple-tv.git but i think this should work as well npm install -g pponce/homebridge-apple-tv
Thanks for that. I tried to install, but I get this error:
root@kali:~/.pm2/logs# npm install -g git+https://git@github.com/pponce/homebridge-apple-tv.git
sodium@3.0.2 preinstall /usr/local/lib/node_modules/homebridge-apple-tv/node_modules/sodium node install.js --preinstall
Static libsodium was not found at /usr/local/lib/node_modules/homebridge-apple-tv/node_modules/sodium/deps/build/lib/libsodium so compiling libsodium from source. libtoolize: error: Failed to create 'build-aux' make: *** [Makefile:62: libsodium] Error 1 /usr/local/lib/node_modules/homebridge-apple-tv/node_modules/sodium/install.js:293 throw new Error(cmdLine + ' exited with code ' + code); ^
Error: make libsodium exited with code 2
at ChildProcess.node install.js --preinstall
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sodium@3.0.2 preinstall 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-12-26T20_36_06_544Z-debug.log root@kali:~/.pm2/logs#
Any idea how to fix this? Thanks.
Sorry I've not encountered your issue. Do you have auticonf automake g++ and libtool installe? Run: sudo apt-get install autoconf automake g++ libtool then try and install again.
Sorry I've not encountered your issue. Do you have auticonf automake g++ and libtool installe? Run: sudo apt-get install autoconf automake g++ libtool then try and install again.
Yes I already did sudo apt-get install autoconf automake g++ libtool
before install and that's what I get... To be very sure, i just ran that command again, followed by the npm install command again, and i get the same error.. as below. Help?
root@kali:/.pm2/logs# sudo apt-get install autoconf automake g++ libtool Reading package lists... Done Building dependency tree Reading state information... Done autoconf is already the newest version (2.69-11). automake is already the newest version (1:1.16.1-4). g++ is already the newest version (4:8.2.0-2). libtool is already the newest version (2.4.6-6). 0 upgraded, 0 newly installed, 0 to remove and 243 not upgraded. root@kali:~/.pm2/logs# npm install -g git+https://git@github.com/pponce/homebridge-apple-tv.git
sodium@3.0.2 preinstall /usr/local/lib/node_modules/homebridge-apple-tv/node_modules/sodium node install.js --preinstall
Static libsodium was not found at /usr/local/lib/node_modules/homebridge-apple-tv/node_modules/sodium/deps/build/lib/libsodium so compiling libsodium from source. libtoolize: error: Failed to create 'build-aux' make: *** [Makefile:62: libsodium] Error 1 /usr/local/lib/node_modules/homebridge-apple-tv/node_modules/sodium/install.js:293 throw new Error(cmdLine + ' exited with code ' + code); ^
Error: make libsodium exited with code 2
at ChildProcess.node install.js --preinstall
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sodium@3.0.2 preinstall 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-12-27T02_48_09_871Z-debug.log root@kali:~/.pm2/logs#
Any ideas please? Thanks.
I am having similar issues with sodium as well -- can anyone assist me?
Currently running node: 11.6.0, raspberry 3
Installed plugin successfully using: sudo npm install -g homebridge-apple-tv --unsafe-perm
When I attempt to run homebridge, I receive the following error. Also, I am attempting to run this plugin with the Nest plugin (which is active and working).
[1/4/2019, 8:32:37 AM] ==================== [1/4/2019, 8:32:37 AM] ERROR LOADING PLUGIN homebridge-apple-tv: [1/4/2019, 8:32:37 AM] Error: Cannot find module '../build/Release/sodium' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15) at Function.Module._load (internal/modules/cjs/loader.js:529:25) at Module.require (internal/modules/cjs/loader.js:657:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-apple-tv/node_modules/sodium/lib/sodium.js:16:15) at Module._compile (internal/modules/cjs/loader.js:721:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:560:12) at Function.Module._load (internal/modules/cjs/loader.js:552:3) [1/4/2019, 8:32:37 AM] ====================
Any ideas on how to resolve this? I tried updating and following the instructions above, but no luck. Thanks!
I was able to build with sodium 3. See https://github.com/edc1591/node-appletv/issues/15
I was able to build with sodium 3. See edc1591/node-appletv#15
How did you achieve installing? what commands did you use? i installed sodium 3 and still had problems installing.
@nibty how did you do it. I read article but its for MacOs. im running on Rasbian Stretch Last build.
For anyone who doesn't want to wait for @lprhodes to update his repo, you can install GioCirque's cloned and fixed version with the following command:
npm install -g -save git+https://github.com/GioCirque/homebridge-apple-tv.git
NOTE: if @lprhodes ends up updating his repo and homebridge plugin, and if @GioCirque doesn't continue to maintain his package, you won't see any upgrades and miss out on new features should there be any.
@mkormendy @GioCirque thanks. Lets try this one then. :) Its Better then nothing!
In meanwhile of writing this post. I see for very long time this line:
fetchMetadata: sill resolveWhiteNewModule homebridge-apple-tv@1.0.2 checking installable status
After a while I get this :(
root@raspberrypi:~# npm install -g -save git+https://github.com/GioCirque/homebridge-apple-tv.git
> sodium@3.0.2 preinstall /usr/lib/node_modules/homebridge-apple-tv/node_modules/sodium
> node install.js --preinstall
Static libsodium was not found at /usr/lib/node_modules/homebridge-apple-tv/node_modules/sodium/deps/build/lib/libsodium so compiling libsodium from source.
libtoolize: error: Failed to create 'build-aux'
Makefile:61: recept voor doel 'libsodium' is mislukt
make: *** [libsodium] Fout 1
/usr/lib/node_modules/homebridge-apple-tv/node_modules/sodium/install.js:293
throw new Error(cmdLine + ' exited with code ' + code);
^
Error: make libsodium exited with code 2
at ChildProcess.<anonymous> (/usr/lib/node_modules/homebridge-apple-tv/node_modules/sodium/install.js:293:19)
at ChildProcess.emit (events.js:189:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sodium@3.0.2 preinstall: `node install.js --preinstall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sodium@3.0.2 preinstall 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/2019-02-28T19_59_49_989Z-debug.log
here the /root/.npm/_logs/2019-02-28T19_59_49_989Z-debug.log
I don't have a raspberrypi to try this on. I'd suggest using the --unsafe-perm
argument, and be sure the there are two dashes in the --save
argument.
npm install -g --save --unsafe-perm git+https://github.com/GioCirque/homebridge-apple-tv.git
I got this repo to install last night after initially having this issue with sodium.
I manually installed automake
and sodium
and apt-get libtool
then retried this install via homebridge-config-ui-x
. I believe that's what fixed it, since it will see the latest install of sodium already on device and skip over it.
Yeah, just install libsodium before installing the plugin
Wow, @GioCirque after almost an hour on my PI it finally worked, tks
So, after a long (long) night with the infamous error "Failed at the sodium@2.0.3 preinstall script" - I was finally able to get this plugin up and running (works very nice)
I don't know exactly what I did that made the trick, I must be honest. But in order to (maybe) help others that come here, I decided to go back to the logs, extract (most of) my "sudo" commands, and list them here. Listed in brackets are outputs worth mentioning:
pi@raspberrypi:~ $ sudo npm i -g npm
pi@raspberrypi:~/.homebridge $ sudo apt-get update
pi@raspberrypi:~/.homebridge $ sudo apt-get clean
pi@raspberrypi:~/.homebridge $ sudo apt-get autoremove
pi@raspberrypi:~/.homebridge $ sudo apt-get --reinstall install autoconf automake g++ libtool
pi@raspberrypi:~/.homebridge $ sudo apt-get --purge remove autoconf automake g++ libtool
pi@raspberrypi:~/.homebridge $ sudo apt-get install autoconf automake g++ libtool
pi@raspberrypi:~/.homebridge $ sudo npm install -g libsodium
pi@raspberrypi:~/.homebridge $ sudo apt-get update -y && sudo apt-get upgrade -y && sudo npm i -g npm
pi@raspberrypi:~/.homebridge $ sudo npm install -g homebridge-apple-tv --unsafe-perm
pi@raspberrypi:~/.homebridge $ sudo apt-get update
pi@raspberrypi:~/.homebridge $ sudo apt-get dist-upgrade
pi@raspberrypi:~/.homebridge $ sudo npm rebuild
(libsodium@0.7.4 /home/pi/.homebridge/node_modules/libsodium)
pi@raspberrypi:~/.homebridge $ sudo npm install -g homebridge-apple-tv --unsafe-perm
(+ homebridge-apple-tv@1.0.2)
(updated 1 package in 102.573s)
pi@raspberrypi:~/.homebridge $ pm2 restart homebridge
pi@raspberrypi:~/.homebridge $ sudo npm install -g homebridge-apple-tv --unsafe-perm
(+ homebridge-apple-tv@1.0.2)
(added 259 packages from 215 contributors in 3334.2s)
Afer installation, worth mentioning, I didn't see any switch to pair my AppleTV in the home app...
I needed to do the following sequence:
pi@raspberrypi:/ $ cd /usr/local/lib/node_modules/homebridge-apple-tv
(** worth mentioning: this is the location in my case where the plugin was installed... pi zero)
pi@raspberrypi:/usr/local/lib/node_modules/homebridge-apple-tv $ cd node_modules/node-appletv/bin
pi@raspberrypi:/usr/local/lib/node_modules/homebridge-apple-tv/node_modules/node-appletv/bin $ ./appletv pair
Which Apple TV would you like to pair with? Living Room (192.168.1.3:49164)
Living Room
Living Room
(here I used the arrows to choose the SECOND one)
? Enter the 4-digit pin that's currently being displayed on Living Room 6856
Then, I received the credential, copied it, and added it as part of this block that I added to config.json:
"platform": "AppleTV",
"name": "Omri's Apple TV",
"showDefaultSwitches": true,
"defaultSwitchesIncludeATVName": true,
"showPairSwitches": false,
"hideWelcomeMessage": true,
"devices": [
{
"id": "Omris",
"name": "Omris Apple TV",
"credentials": "pasted-credentials-here"
}
],
"accessories": [
{
"deviceID": "Omris",
"name": "Rainbow",
"command": []
}
Good luck guys!
Okay. So I had to follow the "standard" process (install automake, libtool and sodium etc. before installing the plugin) and ALSO downgrade to NodeJS V8. Using the NodeJS 8 version (8.16.0) fixed my problem!
@omriavital which AppleTV generation are you working with? Cause everything is working now but ./appletv pair
tells me No Apple TVs found on the network. Try again.
@marius-se
Here the same excact problem. Before it was working fine here. My first install six months ago was not easy, same problems as everyone else (sodium 2.0.3). But in the end I got it working just fine!
Then I decided (now i do regret that) because of some version (node, hue) "warnings " to try updating homebridge, homebridge-heu to newer version. It still worked fine but it seemed the newest plugin and versions did/could not load because of the older plugin was allreay loaded.It still worked but i decided tot try to repair that without succes.
In the end I decided to start from scratch, new DebianOS, new homebridge-install, the works... The second time the installation of all went a lot faster because of the previous experiance.
But then: Same error
No Apple TVs found on the network. Try again.
Same network, same AppleTV, same Pi, same Hue Hub.... Apple TV has IP 192.182.1.13, Pi has ip 192.168.1.14. Both work fine on the netwerk (with cable). I have done the installation and Apple TV pair via ssh.
Somebody an idea where to search for the solution?
Could the problem be that the plugins and homebridge are on different locations?
The same problem seemed to be with the version updates.
Apple TV Pair is located in this folder:
~/.nvm/versions/node/v10.16.3/lib/node_modules/homebridge-apple-tv/node_modules/node-appletv/bin $ ./appletv pair
WARNING The program 'node' uses the Apple Bonjour compatibility layer of Avahi. WARNING Please fix your application to use the native API of Avahi! WARNING For more information see http://0pointer.de/blog/projects/avahi-compat.html WARNING The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. WARNING Please fix your application to use the native API of Avahi! WARNING For more information see http://0pointer.de/blog/projects/avahi-compat.html No Apple TVs found on the network. Try again.
But in previous posts I see it should be located in:
/usr/local/lib/node_modules $ cd homebridge-apple-tv -bash: cd: homebridge-apple-tv: Bestand of map bestaat niet
But there seems to be no such folder. Is this a node version problem, should I degrade my node version? Hue wants this version...10.6.3
For people still running into this, you must use node version 8. It's the only thing that worked for me.
Is there any other chance to get this plugin running except of downgrading node? I have a lot of other plugins installed and i dont want to run in more issues after a downgrade..
omriavitals workaround didnt worked for me.
Keep getting this error when trying to install it on my Homebridge Docker on Synology install.
`USER: root DIR: /var/lib/homebridge CMD: npm install --save homebridge-apple-tv@1.0.2
[##################] - reify:sodium: timing reifyNode:node_modules/homebridge-apple-tv/no
sodium@3.0.2 preinstall node install.js --preinstall
Static libsodium was not found at /homebridge/node_modules/homebridge-apple-tv/node_modules/sodium/deps/build/lib/libsodium so compiling libsodium from source. libtool is required, but wasn't found on this system make: *** [Makefile:62: libsodium] Error 1 /homebridge/node_modules/homebridge-apple-tv/node_modules/sodium/install.js:293 throw new Error(cmdLine + ' exited with code ' + code); ^
Error: make libsodium exited with code 2
at ChildProcess.
Node.js v18.12.1 npm ERR! code 1 npm ERR! path /homebridge/node_modules/homebridge-apple-tv/node_modules/sodium npm ERR! command failed npm ERR! command sh -c -- node install.js --preinstall
npm ERR! A complete log of this run can be found in: npm ERR! /home/homebridge/.npm/_logs/2022-12-24T03_37_39_383Z-debug-0.log
Operation failed. Please review log for details.`
I went ahead and installed Sodium via npm install -g libsodium which installed fine but trying to install homebridge-apple-tv keeps giving me this error. =(
Thanks in advance!
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