hap-client
hap-client copied to clipboard
Problem installation
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
[email protected] 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.
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/2017-12-13T20_03_17_654Z-debug.log
What Do I have to do?
Expirencing the same issue.
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:
> [email protected] 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! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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
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).
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.
Any Idea?
just in case for other who face this problem. You need to install : sudo apt install build-essential automake libtool autoconf libsecret-1-dev
@dragouf any idea how i would fix the same issue on windows?
@forty2 wouldyou be pen for a PR to updste deps and fixing some "long responses" errors?