hap-client-tool icon indicating copy to clipboard operation
hap-client-tool copied to clipboard

npm install: Error: make libsodium exited with code 2

Open lboue opened this issue 7 years ago • 2 comments

Hello,

Could you tell me how to install hap-client-tool with npm because it doesn't work with the last release: I can't install it

pi@raspberrypi:~ $ sudo su -      
root@raspberrypi:~# npm install -g hap-client-tool

> [email protected] preinstall /usr/lib/node_modules/hap-client-tool/node_modules/sodium
> node install.js --preinstall

Static libsodium was not found at /usr/lib/node_modules/hap-client-tool/node_modules/sodium/deps/build/lib/libsodium so compiling libsodium from source.
libtoolize:   error: Failed to create 'build-aux'
make: *** [libsodium] Erreur 1
Makefile:61 : la recette pour la cible « libsodium » a échouée
/usr/lib/node_modules/hap-client-tool/node_modules/sodium/install.js:287
            throw new Error(cmdLine + ' exited with code ' + code);
            ^

Error: make libsodium exited with code 2
    at ChildProcess.<anonymous> (/usr/lib/node_modules/hap-client-tool/node_modules/sodium/install.js:287:19)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
[            ......] - preinstall: info lifecycle [email protected]~preinstall: Failed to exec preinstall script
[            ......] - preinstall: info lifecycle [email protected]~preinstall: Failed to exec preinstall script
[            ......] - preinstall: info lifecycle [email protected]~preinstall: Failed to exec preinstall script
[            ......] - preinstall: info lifecycle [email protected]~preinstall: Failed to exec preinstall script
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-09-30T21_12_49_170Z-debug.log

Regards,

lboue avatar Sep 30 '18 21:09 lboue

You could try: npm install -g hap-client-tool --unsafe-perm

The problem appears to be that it needs that flag to allow it to compile the static version of libsodium it uses.

However, I get an error in compilation as follows:

Error: make nodesodium exited with code null
    at ChildProcess.<anonymous> (/usr/lib/node_modules/hap-client-tool/node_modules/sodium/install.js:287:19)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)

kamilner avatar Jan 03 '19 14:01 kamilner

Installing libsodium separately worked. https://download.libsodium.org/doc/installation

brentrockwood avatar Dec 30 '19 04:12 brentrockwood