paixaop / node-sodium

Port of the lib sodium encryption library to Node.js
MIT License
351 stars 126 forks source link

libtool not found? #136

Closed IngwiePhoenix closed 5 years ago

IngwiePhoenix commented 5 years ago

I used yarn to add this to my project, but I get:

error /Users/Ingwie/Work/DragonsInn/BIRD3/node_modules/sodium: Command failed.
Exit code: 1
Command: node install.js --preinstall
Arguments: 
Directory: /Users/Ingwie/Work/DragonsInn/BIRD3/node_modules/sodium
Output:
Static libsodium was not found at /Users/Ingwie/Work/DragonsInn/BIRD3/node_modules/sodium/deps/build/lib/libsodium so compiling libsodium from source.
libtool is required, but wasn't found on this system
make: *** [libsodium] Error 1
/Users/Ingwie/Work/DragonsInn/BIRD3/node_modules/sodium/install.js:287
            throw new Error(cmdLine + ' exited with code ' + code);
            ^

Error: make libsodium exited with code 2

Meanwhile, libtool exists:

Ingwie@Ingwies-Macbook-Pro.local ~/W/D/BIRD3 $ which libtool
/usr/bin/libtool

Trying to execute that results in:

Ingwie@Ingwies-Macbook-Pro.local ~/W/D/BIRD3 $ libtool
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: no output file specified (specify with -o output)
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]

So, I do not quite understand how libtool could not be found, when it actually is in $PATH...

paixaop commented 5 years ago

can you try compile libsodium from command line directly?

Please try:

cd deps/libsodium/ 
make clean > /dev/null
./autogen.sh
./configure --enable-static --enable-shared --with-pic
make -j3 check

You'll have to fix any autogen, configure or make errors before node-sodium can compile.

Usually these errors are fixed by running

brew install libtool autoconf automake

from the readme.md