node-scrypt icon indicating copy to clipboard operation
node-scrypt copied to clipboard

dyld: lazy symbol binding failed: Symbol not found: _clock_getres

Open graynun opened this issue 8 years ago • 2 comments

I use node v.6.6.0 with npm 3.10.3. The install log for scrypt using npm was this;

$ npm install scrypt

[email protected] preinstall /Users/[user]/Desktop/scrypt/node_modules/.staging/scrypt-266b8e33 node node-scrypt-preinstall.js

[email protected] install /Users/[user]/Desktop/scrypt/node_modules/scrypt node-gyp rebuild

SOLINK_MODULE(target) Release/copied_files.node clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 CC(target) Release/obj.target/scrypt_wrapper/src/util/memlimit.o CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/keyderivation.o CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/pickparams.o CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/hash.o LIBTOOL-STATIC Release/scrypt_wrapper.a CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/crypto/crypto_scrypt.o CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/crypto/crypto_scrypt_smix.o CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/util/warnp.o CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/alg/sha256.o CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/util/insecure_memzero.o CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/scryptenc/scryptenc_cpuperf.o LIBTOOL-STATIC Release/scrypt_lib.a CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_common.o CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_async.o CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_sync.o CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_kdf_async.o CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_kdf_sync.o CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_kdf-verify_sync.o CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_kdf-verify_async.o CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_hash_sync.o CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_hash_async.o CXX(target) Release/obj.target/scrypt/scrypt_node.o SOLINK_MODULE(target) Release/scrypt.node clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 /Users/[user]/Desktop/scrypt └─┬ [email protected] └── [email protected]

When I try to run a test super short test code like below, `let scrypt = require('scrypt');

scrypt.params(0.2).then((param)=>{ console.log(param); });`

This error comes up.

$ node test.js dyld: lazy symbol binding failed: Symbol not found: _clock_getres Referenced from: /Users/youngimjo/Desktop/scrypt/node_modules/scrypt/build/Release/scrypt.node Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _clock_getres Referenced from: /Users/youngimjo/Desktop/scrypt/node_modules/scrypt/build/Release/scrypt.node Expected in: /usr/lib/libSystem.B.dylib

Trace/BPT trap: 5

I do have libSystem.B.dylib in usr/lib/, so I have no idea why the module fails to binding symbols. Any idea?

graynun avatar Sep 23 '16 13:09 graynun

I think it's related with Xcode 8.0 - I downgraded Xcodel to 7.3.1 and reinstalled scrypt npm package and it worked!

graynun avatar Sep 23 '16 14:09 graynun

I was able to solve this with Xcode 8.0 by installing the Xcode command line tools (CLT).

Running xcode-select --install in the terminal will open an Xcode CLT GUI installer (assuming they're not already installed). After the installer finishes, run npm rebuild to rebuild scrypt.

If you have homebrew installed, you can run brew config to see if the CLT are installed. If they're not installed, you should see output which includes something like:

...
macOS: 10.11.6-x86_64
Xcode: 8.0
CLT: N/A
...

After they're installed, you'll see something like:

...
macOS: 10.11.6-x86_64
Xcode: 8.0
CLT: 8.2.0.0.1.1480973914
...

JoshuaToenyes avatar Dec 26 '16 04:12 JoshuaToenyes