forty2 / hap-client

Control HomeKit-enabled devices with Node
MIT License
27 stars 13 forks source link

Problem installation #3

Open NDNELSON opened 6 years ago

NDNELSON commented 6 years ago

Hello and thanks for your module I am trying to install this on a raspberry pi 3 with jessie

I am running homebridge perfectly but i can install your plugin I have this error

pi@raspberrypi:~ $ sudo npm install hap-client --save

sodium@2.0.3 preinstall /home/pi/node_modules/sodium node install.js --preinstall

Static libsodium was not found at /home/pi/node_modules/sodium/deps/build/lib/libsodium so compiling libsodium from source. libtool is required, but wasn't found on this system Makefile:61: recipe for target 'libsodium' failed make: *** [libsodium] Error 1 /home/pi/node_modules/sodium/install.js:287 throw new Error(cmdLine + ' exited with code ' + code); ^

Error: make libsodium exited with code 2 at ChildProcess. (/home/pi/node_modules/sodium/install.js:287: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 WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json' npm WARN pi No description npm WARN pi No repository field. npm WARN pi No README data npm WARN pi No license field.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! sodium@2.0.3 preinstall: node install.js --preinstall npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sodium@2.0.3 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/2017-12-13T20_03_17_654Z-debug.log

What Do I have to do?

ehog90 commented 6 years ago

Expirencing the same issue.

satoshinm commented 6 years ago

Interesting, I'm also on a Raspberry Pi 3 with Raspbian but libsodium installs without error (cloned from this git repo then npm install), instead it fails on installing keytar:

> keytar@4.1.0 install /home/pi/homebridge/homebridge-toggle-client/hap-client/node_modules/keytar
> node-gyp rebuild

Package libsecret-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsecret-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsecret-1' found
gyp: Call to 'pkg-config --libs-only-l libsecret-1' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.4.21-v7+
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/homebridge/homebridge-toggle-client/hap-client/node_modules/keytar
gyp ERR! node -v v6.7.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 
...
npm ERR! Linux 4.4.21-v7+
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE

npm ERR! keytar@4.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the keytar@4.1.0 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the keytar package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs keytar
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls keytar
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/pi/homebridge/homebridge-toggle-client/hap-client/npm-debug.log

full log: https://gist.github.com/satoshinm/6f92dce5a3340e89568ef39839308b40

satoshinm commented 6 years ago

So I removed keytar and was able to install hap-client on the Pi: https://github.com/satoshinm/hap-client/commit/86eec639f9ba41943d12977d29857e62c0cce153

However I now see possibly the same libsodium installation problem:

 $ node
> require('./')
Error: Cannot find module '../build/Release/sodium'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/pi/homebridge/homebridge-toggle-client/hap-client/node_modules/sodium/lib/sodium.js:16:15)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
> 

any ideas? The libsodium module (WebAssembly and pure JS) might be easier to install than sodium (native bindings).

NDNELSON commented 6 years ago

Finally I can Install hap-client in a raspberry pi but I have another problem, when I run the example code i get this error:

module.js:538 throw err; ^

Error: Cannot find module '../build/Release/keytar.node' at Function.Module._resolveFilename (module.js:536:15) at Function.Module._load (module.js:466:25) at Module.require (module.js:579:17) at require (internal/module.js:11:18) at Object. (/home/pi/node_modules/keytar/lib/keytar.js:1:76) at Module._compile (module.js:635:30) at Object.Module._extensions..js (module.js:646:10) at Module.load (module.js:554:32) at tryModuleLoad (module.js:497:12) at Function.Module._load (module.js:489:3)

Any Idea?

dragouf commented 6 years ago

just in case for other who face this problem. You need to install : sudo apt install build-essential automake libtool autoconf libsecret-1-dev

toclean commented 6 years ago

@dragouf any idea how i would fix the same issue on windows?

Apollon77 commented 3 years ago

@forty2 wouldyou be pen for a PR to updste deps and fixing some "long responses" errors?