homebridge-apple-tv icon indicating copy to clipboard operation
homebridge-apple-tv copied to clipboard

Cannot install Error: [email protected]

Open justinrhodes opened this issue 5 years ago • 44 comments

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: [email protected] 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 [email protected]
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 [email protected] install: `node install.js --install`
error Exit status 1
error Failed at the [email protected] install script.
error This is probably not a problem with npm. There is likely additional logging output above.
6656 verbose exit [ 1, true ]

justinrhodes avatar Nov 25 '18 20:11 justinrhodes

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.

rpeterson03 avatar Nov 25 '18 23:11 rpeterson03

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. (/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! [email protected] install: node install.js --install npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] 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`

dornadeluxe avatar Nov 27 '18 19:11 dornadeluxe

same problem here

reiterbene avatar Nov 27 '18 20:11 reiterbene

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"

justinrhodes avatar Nov 27 '18 20:11 justinrhodes

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 [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/homebridge/node_modules/node-appletv/node_modules/sodium'
8624 warn rollback Rolling back [email protected] 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 [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/homebridge/node_modules/node-appletv/node_modules/sodium'

justinrhodes avatar Nov 28 '18 05:11 justinrhodes

Is the developer still active? Or did anyone else achieve any progress?

dornadeluxe avatar Dec 02 '18 17:12 dornadeluxe

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.

justinrhodes avatar Dec 03 '18 02:12 justinrhodes

Same issue here.

Screenfeed avatar Dec 05 '18 19:12 Screenfeed

Same for me, can't install

chimai avatar Dec 19 '18 20:12 chimai

try pponce/homebridge-apple-tv

pponce avatar Dec 19 '18 22:12 pponce

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.

chimai avatar Dec 20 '18 10:12 chimai

Same here on a Synology NAS (node.js v10.13)...

Alcor72 avatar Dec 20 '18 17:12 Alcor72

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

pponce avatar Dec 20 '18 19:12 pponce

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.

t0xicfume avatar Dec 21 '18 05:12 t0xicfume

npm install -g git+https://[email protected]/pponce/homebridge-apple-tv.git but i think this should work as well npm install -g pponce/homebridge-apple-tv

pponce avatar Dec 21 '18 16:12 pponce

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...

Alcor72 avatar Dec 21 '18 17:12 Alcor72

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 avatar Dec 23 '18 09:12 dornadeluxe

@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.

pponce avatar Dec 23 '18 16:12 pponce

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'.

dornadeluxe avatar Dec 23 '18 22:12 dornadeluxe

I deleted the accessories folder and tried again and now it works, hallelujah! :) Thanks for your help and Merry Christmas!

dornadeluxe avatar Dec 24 '18 11:12 dornadeluxe

Glad you figured that last one out. I was stumped.. Merry Christmas!

pponce avatar Dec 24 '18 15:12 pponce

@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.

TommyCardello avatar Dec 26 '18 06:12 TommyCardello

npm install -g git+https://[email protected]/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://[email protected]/pponce/homebridge-apple-tv.git

[email protected] 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. (/usr/local/lib/node_modules/homebridge-apple-tv/node_modules/sodium/install.js:293:19) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] preinstall: node install.js --preinstall npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] 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.

t0xicfume avatar Dec 26 '18 20:12 t0xicfume

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.

pponce avatar Dec 27 '18 01:12 pponce

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://[email protected]/pponce/homebridge-apple-tv.git

[email protected] 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. (/usr/local/lib/node_modules/homebridge-apple-tv/node_modules/sodium/install.js:293:19) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] preinstall: node install.js --preinstall npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] 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.

t0xicfume avatar Dec 27 '18 02:12 t0xicfume

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!

ronnieescorpiso avatar Jan 04 '19 16:01 ronnieescorpiso

I was able to build with sodium 3. See https://github.com/edc1591/node-appletv/issues/15

nibty avatar Jan 24 '19 02:01 nibty

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.

NajibNour avatar Jan 31 '19 01:01 NajibNour

@nibty how did you do it. I read article but its for MacOs. im running on Rasbian Stretch Last build.

poudenes avatar Feb 17 '19 08:02 poudenes

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 avatar Feb 28 '19 17:02 mkormendy