Missing module Sodium
re2005 opened this issue · 7 comments
Anyone facing the same issue ?
MAC node 14.5.0 or 10.18.0
ERROR Failed to compile with 19 errors 9:33:51 PM
These relative modules were not found:
* ../../build/Release/sodium in ./node_modules/sodium/lib/keys/box-key.js, ./node_modules/sodium/lib/keys/auth-key.js and 8 others
* ../build/Release/sodium in ./node_modules/sodium/lib/sodium.js, ./node_modules/sodium/lib/box.js and 7 others
Hey, in which step you met this issue? For me, seems good while using node 10.18.0 under Mac OS.
During installation I'm getting few deprecation items (check bellow)
I've created a repo to show what's going on.
https://github.com/re2005/zilliqa-js-lib
<scratch space>:200:1: note: expanded from here crypto_core_salsa208_constbytes ^ ../deps/build/include/sodium/crypto_core_salsa208.h:29:29: note: 'crypto_core_salsa208_constbytes' has been explicitly marked deprecated here __attribute__ ((deprecated)); ^ ../src/crypto_core.cc:15:1: warning: 'crypto_core_salsa208_inputbytes' is deprecated [-Wdeprecated-declarations] CRYPTO_CORE_DEF(salsa208) ^ ../src/include/crypto_core.h:25:26: note: expanded from macro 'CRYPTO_CORE_DEF' NAPI_METHOD_FROM_INT(crypto_core_ ## ALGO ## _inputbytes); \ ^ <scratch space>:204:1: note: expanded from here crypto_core_salsa208_inputbytes ^ ../deps/build/include/sodium/crypto_core_salsa208.h:19:29: note: 'crypto_core_salsa208_inputbytes' has been explicitly marked deprecated here __attribute__ ((deprecated)); ^ ../src/crypto_core.cc:15:1: warning: 'crypto_core_salsa208_keybytes' is deprecated [-Wdeprecated-declarations] CRYPTO_CORE_DEF(salsa208) ^ ../src/include/crypto_core.h:26:26: note: expanded from macro 'CRYPTO_CORE_DEF' NAPI_METHOD_FROM_INT(crypto_core_ ## ALGO ## _keybytes); \ ^ <scratch space>:208:1: note: expanded from here crypto_core_salsa208_keybytes ^ ../deps/build/include/sodium/crypto_core_salsa208.h:24:29: note: 'crypto_core_salsa208_keybytes' has been explicitly marked deprecated here __attribute__ ((deprecated)); ^ ../src/crypto_core.cc:15:1: warning: 'crypto_core_salsa208_outputbytes' is deprecated [-Wdeprecated-declarations] CRYPTO_CORE_DEF(salsa208) ^ ../src/include/crypto_core.h:27:26: note: expanded from macro 'CRYPTO_CORE_DEF' NAPI_METHOD_FROM_INT(crypto_core_ ## ALGO ## _outputbytes) ^ <scratch space>:212:1: note: expanded from here crypto_core_salsa208_outputbytes ^ ../deps/build/include/sodium/crypto_core_salsa208.h:14:29: note: 'crypto_core_salsa208_outputbytes' has been explicitly marked deprecated here __attribute__ ((deprecated)); ^ 4 warnings generated. CXX(target) Release/obj.target/sodium/src/crypto_scalarmult_curve25519.o CXX(target) Release/obj.target/sodium/src/crypto_scalarmult.o CXX(target) Release/obj.target/sodium/src/crypto_secretbox_xsalsa20poly1305.o CXX(target) Release/obj.target/sodium/src/crypto_secretbox.o CXX(target) Release/obj.target/sodium/src/sodium.o CXX(target) Release/obj.target/sodium/src/crypto_stream.o CXX(target) Release/obj.target/sodium/src/crypto_streams.o ../src/crypto_streams.cc:16:1: warning: 'crypto_stream_salsa208' is deprecated [-Wdeprecated-declarations] CRYPTO_STREAM_DEF(salsa208) ^ ../src/include/crypto_streams.h:19:13: note: expanded from macro 'CRYPTO_STREAM_DEF' if (crypto_stream_ ## ALGO (stream_ptr, slen, nonce, key) == 0) { \ ^ <scratch space>:249:1: note: expanded from here crypto_stream_salsa208 ^ ../deps/build/include/sodium/crypto_stream_salsa208.h:40:29: note: 'crypto_stream_salsa208' has been explicitly marked deprecated here __attribute__ ((deprecated)); ^ ../src/crypto_streams.cc:16:1: warning: 'crypto_stream_salsa208_xor' is deprecated [-Wdeprecated-declarations] CRYPTO_STREAM_DEF(salsa208) ^ ../src/include/crypto_streams.h:31:13: note: expanded from macro 'CRYPTO_STREAM_DEF' if (crypto_stream_ ## ALGO ## _xor(ctxt_ptr, message, message_size, nonce, key) == 0) { \ ^ <scratch space>:38:1: note: expanded from here crypto_stream_salsa208_xor ^ ../deps/build/include/sodium/crypto_stream_salsa208.h:46:29: note: 'crypto_stream_salsa208_xor' has been explicitly marked deprecated here __attribute__ ((deprecated)); ^ ../src/crypto_streams.cc:16:1: warning: 'crypto_stream_salsa208_keybytes' is deprecated [-Wdeprecated-declarations] CRYPTO_STREAM_DEF(salsa208) ^ ../src/include/crypto_streams.h:36:26: note: expanded from macro 'CRYPTO_STREAM_DEF' NAPI_METHOD_FROM_INT(crypto_stream_ ## ALGO ## _keybytes); \ ^ <scratch space>:40:1: note: expanded from here crypto_stream_salsa208_keybytes ^ ../deps/build/include/sodium/crypto_stream_salsa208.h:25:29: note: 'crypto_stream_salsa208_keybytes' has been explicitly marked deprecated here __attribute__ ((deprecated)); ^ ../src/crypto_streams.cc:16:1: warning: 'crypto_stream_salsa208_noncebytes' is deprecated [-Wdeprecated-declarations] CRYPTO_STREAM_DEF(salsa208) ^ ../src/include/crypto_streams.h:37:26: note: expanded from macro 'CRYPTO_STREAM_DEF' NAPI_METHOD_FROM_INT(crypto_stream_ ## ALGO ## _noncebytes) ^ <scratch space>:44:1: note: expanded from here crypto_stream_salsa208_noncebytes ^ ../deps/build/include/sodium/crypto_stream_salsa208.h:30:29: note: 'crypto_stream_salsa208_noncebytes' has been explicitly marked deprecated here __attribute__ ((deprecated)); ^ 4 warnings generated. CXX(target) Release/obj.target/sodium/src/helpers.o CXX(target) Release/obj.target/sodium/src/randombytes.o CXX(target) Release/obj.target/sodium/src/crypto_pwhash_algos.o CXX(target) Release/obj.target/sodium/src/crypto_pwhash.o CXX(target) Release/obj.target/sodium/src/crypto_hash.o CXX(target) Release/obj.target/sodium/src/crypto_hash_sha256.o CXX(target) Release/obj.target/sodium/src/crypto_hash_sha512.o CXX(target) Release/obj.target/sodium/src/crypto_shorthash.o CXX(target) Release/obj.target/sodium/src/crypto_shorthash_siphash24.o CXX(target) Release/obj.target/sodium/src/crypto_generichash.o CXX(target) Release/obj.target/sodium/src/crypto_generichash_blake2b.o CXX(target) Release/obj.target/sodium/src/crypto_onetimeauth.o CXX(target) Release/obj.target/sodium/src/crypto_onetimeauth_poly1305.o SOLINK_MODULE(target) Release/sodium.node
I had a similar issue.
The problem was caused by "fsevents" not being installed due to some "incompatibility issue".
What worked for me was ditching yarn & downgrading node to 11.0.0 (using n
)
npm cache clean --force # clear old npm files
npm i -f # force install all dependencies including optional ones
This solution also seemed to have fixed other issues I had related to #249, #176
P.S I am on linux using version 0.11.1
instead of 1.0-alpha
Thanks for the reply @as1ndu
ERROR Failed to compile with 19 errors 9:59:51 AM
These relative modules were not found:
* ../../build/Release/sodium in ./node_modules/sodium/lib/keys/auth-key.js, ./node_modules/sodium/lib/keys/box-key.js and 8 others
* ../build/Release/sodium in ./node_modules/sodium/lib/sodium.js, ./node_modules/sodium/lib/box.js and 7 others
No type errors found
Version: typescript 3.9.7
Time: 2042ms
Maybe my setup is missing a dependency or so, what I think is weird because NPM should cover everything.
The same setup was working months ago, probably some update on the dependencies.
We're using yarn & node 12.18 with our website, I initially experienced this issue as well as #249 #176. I ran:
yarn cache clean --all
That solved my issues with installing & using the library although the errors from scrypt.js (#172) still appear on install.
yarn v1.22.5
node v12.18.1
@zilliqa-js/zilliqa v0.11.1
The missing node sodium error is due to some path-finding issues with the sodium build library.
The sodium library compiles and builds from the source directly during npm install
. Some of the sodium files import ../build/Release/sodium
and front-end frameworks such as vue and react apparently have some trouble with resolving this relative path ../build/Release/sodium
and hence the error.
The latest release 1.0.0
fixes the mentioned issues.
@re2005 I have modified your sample project using the latest release. It is working with Ubuntu / node 10.22.0.
Link to sample vue project with zilliqa-js
For macOS, if you encountered a node-gyp build error, you might want to try executing the following and run npm install
again:
brew install libtool autoconf automake
Hi, thanks everybody for the solutions.
I think by cleaning everything and re-installing the latest version "1.0.0" it's working just fine!
I've a bunch of warning that may be regards to my setup, but I'll leave here if you guys are curious.
npm install @zilliqa-js/zilliqa ✔ 47s
> scrypt@6.0.3 preinstall /Users/***/zilliqa-dapp/node_modules/scrypt
> node node-scrypt-preinstall.js
> bufferutil@4.0.1 install /Users/***/zilliqa-dapp/node_modules/bufferutil
> node-gyp-build
> scrypt@6.0.3 install /Users/***/zilliqa-dapp/node_modules/scrypt
> node-gyp rebuild
SOLINK_MODULE(target) Release/copied_files.node
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
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:
../src/node-boilerplate/inc/scrypt_common.h:39:14: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
N(obj->Get(Nan::New("N").ToLocalChecked())->Uint32Value()),
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8.h:3553:3: note: 'Get' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", Local<Value> Get(Local<Value> key));
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8config.h:328:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:
../src/node-boilerplate/inc/scrypt_common.h:39:63: error: too few arguments to function call, single argument 'context' was not specified
N(obj->Get(Nan::New("N").ToLocalChecked())->Uint32Value()),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8.h:2707:3: note: 'Uint32Value' declared here
V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8config.h:368:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:
../src/node-boilerplate/inc/scrypt_common.h:40:14: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
r(obj->Get(Nan::New("r").ToLocalChecked())->Uint32Value()),
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8.h:3553:3: note: 'Get' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", Local<Value> Get(Local<Value> key));
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8config.h:328:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:
../src/node-boilerplate/inc/scrypt_common.h:40:63: error: too few arguments to function call, single argument 'context' was not specified
r(obj->Get(Nan::New("r").ToLocalChecked())->Uint32Value()),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8.h:2707:3: note: 'Uint32Value' declared here
V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8config.h:368:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:
../src/node-boilerplate/inc/scrypt_common.h:41:14: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
p(obj->Get(Nan::New("p").ToLocalChecked())->Uint32Value()) {}
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8.h:3553:3: note: 'Get' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", Local<Value> Get(Local<Value> key));
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8config.h:328:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:
../src/node-boilerplate/inc/scrypt_common.h:41:63: error: too few arguments to function call, single argument 'context' was not specified
p(obj->Get(Nan::New("p").ToLocalChecked())->Uint32Value()) {}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8.h:2707:3: note: 'Uint32Value' declared here
V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8config.h:368:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
../src/node-boilerplate/inc/scrypt_async.h:53:17: warning: 'Call' is deprecated [-Wdeprecated-declarations]
callback->Call(1, argv);
^
../../nan/nan.h:1741:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local<v8::Value>
^
../../nan/nan.h:106:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_params_async.h:35:36: error: too few arguments to function call, single argument 'context' was not specified
maxtime(info[0]->NumberValue()),
~~~~~~~~~~~~~~~~~~~~ ^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8.h:2704:3: note: 'NumberValue' declared here
V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8config.h:368:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_params_async.h:36:39: error: too few arguments to function call, single argument 'context' was not specified
maxmemfrac(info[1]->NumberValue()),
~~~~~~~~~~~~~~~~~~~~ ^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8.h:2704:3: note: 'NumberValue' declared here
V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8config.h:368:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_params_async.h:37:36: error: too few arguments to function call, single argument 'context' was not specified
maxmem(info[2]->IntegerValue()),
~~~~~~~~~~~~~~~~~~~~~ ^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8.h:2705:3: note: 'IntegerValue' declared here
V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8config.h:368:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_params_async.h:38:39: error: too few arguments to function call, single argument 'context' was not specified
osfreemem(info[3]->IntegerValue())
~~~~~~~~~~~~~~~~~~~~~ ^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8.h:2705:3: note: 'IntegerValue' declared here
V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8config.h:368:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
^
../src/node-boilerplate/scrypt_params_async.cc:23:8: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
obj->Set(Nan::New("N").ToLocalChecked(), Nan::New<Integer>(logN));
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8.h:3498:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version",
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8config.h:328:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/node-boilerplate/scrypt_params_async.cc:24:8: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
obj->Set(Nan::New("r").ToLocalChecked(), Nan::New<Integer>(r));
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8.h:3498:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version",
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8config.h:328:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/node-boilerplate/scrypt_params_async.cc:25:8: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
obj->Set(Nan::New("p").ToLocalChecked(), Nan::New<Integer>(p));
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8.h:3498:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version",
^
/Users/***/Library/Caches/node-gyp/12.18.3/include/node/v8config.h:328:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/node-boilerplate/scrypt_params_async.cc:32:13: warning: 'Call' is deprecated [-Wdeprecated-declarations]
callback->Call(2, argv);
^
../../nan/nan.h:1741:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local<v8::Value>
^
../../nan/nan.h:106:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
8 warnings and 7 errors generated.
make: *** [Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_async.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/***/.nvm/versions/node/v12.18.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/Users/***/.nvm/versions/node/v12.18.3/bin/node" "/Users/***/.nvm/versions/node/v12.18.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/***/zilliqa-dapp/node_modules/scrypt
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
> secp256k1@3.8.0 install /Users/***/zilliqa-dapp/node_modules/secp256k1
> npm run rebuild || echo "Secp256k1 bindings compilation fail. Pure JS implementation will be used."
> secp256k1@3.8.0 rebuild /Users/***/zilliqa-dapp/node_modules/secp256k1
> node-gyp rebuild
CXX(target) Release/obj.target/secp256k1/src/addon.o
CXX(target) Release/obj.target/secp256k1/src/privatekey.o
../src/privatekey.cc:73:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
secp256k1_ec_privkey_negate(secp256k1ctx, &private_key[0]);
^~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/privatekey.cc:4:
In file included from ../src/secp256k1-src/src/scalar_impl.h:10:
In file included from ../src/secp256k1-src/src/group.h:11:
../src/secp256k1-src/src/field.h:36:13: warning: unused function 'secp256k1_fe_normalize' [-Wunused-function]
static void secp256k1_fe_normalize(secp256k1_fe *r);
^
../src/secp256k1-src/src/field.h:39:13: warning: unused function 'secp256k1_fe_normalize_weak' [-Wunused-function]
static void secp256k1_fe_normalize_weak(secp256k1_fe *r);
^
../src/secp256k1-src/src/field.h:42:13: warning: unused function 'secp256k1_fe_normalize_var' [-Wunused-function]
static void secp256k1_fe_normalize_var(secp256k1_fe *r);
^
../src/secp256k1-src/src/field.h:46:12: warning: unused function 'secp256k1_fe_normalizes_to_zero' [-Wunused-function]
static int secp256k1_fe_normalizes_to_zero(secp256k1_fe *r);
^
../src/secp256k1-src/src/field.h:50:12: warning: unused function 'secp256k1_fe_normalizes_to_zero_var' [-Wunused-function]
static int secp256k1_fe_normalizes_to_zero_var(secp256k1_fe *r);
^
../src/secp256k1-src/src/field.h:53:13: warning: unused function 'secp256k1_fe_set_int' [-Wunused-function]
static void secp256k1_fe_set_int(secp256k1_fe *r, int a);
^
../src/secp256k1-src/src/field.h:56:13: warning: unused function 'secp256k1_fe_clear' [-Wunused-function]
static void secp256k1_fe_clear(secp256k1_fe *a);
^
../src/secp256k1-src/src/field.h:59:12: warning: unused function 'secp256k1_fe_is_zero' [-Wunused-function]
static int secp256k1_fe_is_zero(const secp256k1_fe *a);
^
../src/secp256k1-src/src/field.h:62:12: warning: unused function 'secp256k1_fe_is_odd' [-Wunused-function]
static int secp256k1_fe_is_odd(const secp256k1_fe *a);
^
../src/secp256k1-src/src/field.h:65:12: warning: unused function 'secp256k1_fe_equal' [-Wunused-function]
static int secp256k1_fe_equal(const secp256k1_fe *a, const secp256k1_fe *b);
^
../src/secp256k1-src/src/field.h:68:12: warning: unused function 'secp256k1_fe_equal_var' [-Wunused-function]
static int secp256k1_fe_equal_var(const secp256k1_fe *a, const secp256k1_fe *b);
^
../src/secp256k1-src/src/field.h:71:12: warning: unused function 'secp256k1_fe_cmp_var' [-Wunused-function]
static int secp256k1_fe_cmp_var(const secp256k1_fe *a, const secp256k1_fe *b);
^
../src/secp256k1-src/src/field.h:74:12: warning: unused function 'secp256k1_fe_set_b32' [-Wunused-function]
static int secp256k1_fe_set_b32(secp256k1_fe *r, const unsigned char *a);
^
../src/secp256k1-src/src/field.h:77:13: warning: unused function 'secp256k1_fe_get_b32' [-Wunused-function]
static void secp256k1_fe_get_b32(unsigned char *r, const secp256k1_fe *a);
^
../src/secp256k1-src/src/field.h:81:13: warning: unused function 'secp256k1_fe_negate' [-Wunused-function]
static void secp256k1_fe_negate(secp256k1_fe *r, const secp256k1_fe *a, int m);
^
../src/secp256k1-src/src/field.h:85:13: warning: unused function 'secp256k1_fe_mul_int' [-Wunused-function]
static void secp256k1_fe_mul_int(secp256k1_fe *r, int a);
^
../src/secp256k1-src/src/field.h:88:13: warning: unused function 'secp256k1_fe_add' [-Wunused-function]
static void secp256k1_fe_add(secp256k1_fe *r, const secp256k1_fe *a);
^
../src/secp256k1-src/src/field.h:92:13: warning: unused function 'secp256k1_fe_mul' [-Wunused-function]
static void secp256k1_fe_mul(secp256k1_fe *r, const secp256k1_fe *a, const secp256k1_fe * SECP256K1_RESTRICT b);
^
../src/secp256k1-src/src/field.h:96:13: warning: unused function 'secp256k1_fe_sqr' [-Wunused-function]
static void secp256k1_fe_sqr(secp256k1_fe *r, const secp256k1_fe *a);
^
../src/secp256k1-src/src/field.h:103:12: warning: unused function 'secp256k1_fe_sqrt' [-Wunused-function]
static int secp256k1_fe_sqrt(secp256k1_fe *r, const secp256k1_fe *a);
^
../src/secp256k1-src/src/field.h:106:12: warning: unused function 'secp256k1_fe_is_quad_var' [-Wunused-function]
static int secp256k1_fe_is_quad_var(const secp256k1_fe *a);
^
../src/secp256k1-src/src/field.h:110:13: warning: unused function 'secp256k1_fe_inv' [-Wunused-function]
static void secp256k1_fe_inv(secp256k1_fe *r, const secp256k1_fe *a);
^
../src/secp256k1-src/src/field.h:113:13: warning: unused function 'secp256k1_fe_inv_var' [-Wunused-function]
static void secp256k1_fe_inv_var(secp256k1_fe *r, const secp256k1_fe *a);
^
../src/secp256k1-src/src/field.h:118:13: warning: unused function 'secp256k1_fe_inv_all_var' [-Wunused-function]
static void secp256k1_fe_inv_all_var(secp256k1_fe *r, const secp256k1_fe *a, size_t len);
^
../src/secp256k1-src/src/field.h:121:13: warning: unused function 'secp256k1_fe_to_storage' [-Wunused-function]
static void secp256k1_fe_to_storage(secp256k1_fe_storage *r, const secp256k1_fe *a);
^
../src/secp256k1-src/src/field.h:124:13: warning: unused function 'secp256k1_fe_from_storage' [-Wunused-function]
static void secp256k1_fe_from_storage(secp256k1_fe *r, const secp256k1_fe_storage *a);
^
../src/secp256k1-src/src/field.h:127:13: warning: unused function 'secp256k1_fe_storage_cmov' [-Wunused-function]
static void secp256k1_fe_storage_cmov(secp256k1_fe_storage *r, const secp256k1_fe_storage *a, int flag);
^
../src/secp256k1-src/src/field.h:130:13: warning: unused function 'secp256k1_fe_cmov' [-Wunused-function]
static void secp256k1_fe_cmov(secp256k1_fe *r, const secp256k1_fe *a, int flag);
^
In file included from ../src/privatekey.cc:4:
In file included from ../src/secp256k1-src/src/scalar_impl.h:10:
../src/secp256k1-src/src/group.h:44:13: warning: unused function 'secp256k1_ge_set_xy' [-Wunused-function]
static void secp256k1_ge_set_xy(secp256k1_ge *r, const secp256k1_fe *x, const secp256k1_fe *y);
^
../src/secp256k1-src/src/group.h:50:12: warning: unused function 'secp256k1_ge_set_xquad' [-Wunused-function]
static int secp256k1_ge_set_xquad(secp256k1_ge *r, const secp256k1_fe *x);
^
../src/secp256k1-src/src/group.h:54:12: warning: unused function 'secp256k1_ge_set_xo_var' [-Wunused-function]
static int secp256k1_ge_set_xo_var(secp256k1_ge *r, const secp256k1_fe *x, int odd);
^
../src/secp256k1-src/src/group.h:57:12: warning: unused function 'secp256k1_ge_is_infinity' [-Wunused-function]
static int secp256k1_ge_is_infinity(const secp256k1_ge *a);
^
../src/secp256k1-src/src/group.h:60:12: warning: unused function 'secp256k1_ge_is_valid_var' [-Wunused-function]
static int secp256k1_ge_is_valid_var(const secp256k1_ge *a);
^
../src/secp256k1-src/src/group.h:62:13: warning: unused function 'secp256k1_ge_neg' [-Wunused-function]
static void secp256k1_ge_neg(secp256k1_ge *r, const secp256k1_ge *a);
^
../src/secp256k1-src/src/group.h:65:13: warning: unused function 'secp256k1_ge_set_gej' [-Wunused-function]
static void secp256k1_ge_set_gej(secp256k1_ge *r, secp256k1_gej *a);
^
../src/secp256k1-src/src/group.h:68:13: warning: unused function 'secp256k1_ge_set_all_gej_var' [-Wunused-function]
static void secp256k1_ge_set_all_gej_var(secp256k1_ge *r, const secp256k1_gej *a, size_t len);
^
../src/secp256k1-src/src/group.h:75:13: warning: unused function 'secp256k1_ge_globalz_set_table_gej' [-Wunused-function]
static void secp256k1_ge_globalz_set_table_gej(size_t len, secp256k1_ge *r, secp256k1_fe *globalz, const secp256k1_gej *a, const secp256k1_fe *zr);
^
../src/secp256k1-src/src/group.h:78:13: warning: unused function 'secp256k1_ge_set_infinity' [-Wunused-function]
static void secp256k1_ge_set_infinity(secp256k1_ge *r);
^
../src/secp256k1-src/src/group.h:81:13: warning: unused function 'secp256k1_gej_set_infinity' [-Wunused-function]
static void secp256k1_gej_set_infinity(secp256k1_gej *r);
^
../src/secp256k1-src/src/group.h:84:13: warning: unused function 'secp256k1_gej_set_ge' [-Wunused-function]
static void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a);
^
../src/secp256k1-src/src/group.h:87:12: warning: unused function 'secp256k1_gej_eq_x_var' [-Wunused-function]
static int secp256k1_gej_eq_x_var(const secp256k1_fe *x, const secp256k1_gej *a);
^
../src/secp256k1-src/src/group.h:90:13: warning: unused function 'secp256k1_gej_neg' [-Wunused-function]
static void secp256k1_gej_neg(secp256k1_gej *r, const secp256k1_gej *a);
^
../src/secp256k1-src/src/group.h:93:12: warning: unused function 'secp256k1_gej_is_infinity' [-Wunused-function]
static int secp256k1_gej_is_infinity(const secp256k1_gej *a);
^
../src/secp256k1-src/src/group.h:96:12: warning: unused function 'secp256k1_gej_has_quad_y_var' [-Wunused-function]
static int secp256k1_gej_has_quad_y_var(const secp256k1_gej *a);
^
../src/secp256k1-src/src/group.h:100:13: warning: unused function 'secp256k1_gej_double_nonzero' [-Wunused-function]
static void secp256k1_gej_double_nonzero(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr);
^
../src/secp256k1-src/src/group.h:103:13: warning: unused function 'secp256k1_gej_double_var' [-Wunused-function]
static void secp256k1_gej_double_var(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr);
^
../src/secp256k1-src/src/group.h:106:13: warning: unused function 'secp256k1_gej_add_var' [-Wunused-function]
static void secp256k1_gej_add_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_gej *b, secp256k1_fe *rzr);
^
../src/secp256k1-src/src/group.h:109:13: warning: unused function 'secp256k1_gej_add_ge' [-Wunused-function]
static void secp256k1_gej_add_ge(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b);
^
../src/secp256k1-src/src/group.h:114:13: warning: unused function 'secp256k1_gej_add_ge_var' [-Wunused-function]
static void secp256k1_gej_add_ge_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, secp256k1_fe *rzr);
^
../src/secp256k1-src/src/group.h:117:13: warning: unused function 'secp256k1_gej_add_zinv_var' [-Wunused-function]
static void secp256k1_gej_add_zinv_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, const secp256k1_fe *bzinv);
^
../src/secp256k1-src/src/group.h:125:13: warning: unused function 'secp256k1_gej_clear' [-Wunused-function]
static void secp256k1_gej_clear(secp256k1_gej *r);
^
../src/secp256k1-src/src/group.h:128:13: warning: unused function 'secp256k1_ge_clear' [-Wunused-function]
static void secp256k1_ge_clear(secp256k1_ge *r);
^
../src/secp256k1-src/src/group.h:131:13: warning: unused function 'secp256k1_ge_to_storage' [-Wunused-function]
static void secp256k1_ge_to_storage(secp256k1_ge_storage *r, const secp256k1_ge *a);
^
../src/secp256k1-src/src/group.h:134:13: warning: unused function 'secp256k1_ge_from_storage' [-Wunused-function]
static void secp256k1_ge_from_storage(secp256k1_ge *r, const secp256k1_ge_storage *a);
^
../src/secp256k1-src/src/group.h:137:13: warning: unused function 'secp256k1_ge_storage_cmov' [-Wunused-function]
static void secp256k1_ge_storage_cmov(secp256k1_ge_storage *r, const secp256k1_ge_storage *a, int flag);
^
../src/secp256k1-src/src/group.h:140:13: warning: unused function 'secp256k1_gej_rescale' [-Wunused-function]
static void secp256k1_gej_rescale(secp256k1_gej *r, const secp256k1_fe *b);
^
In file included from ../src/privatekey.cc:4:
In file included from ../src/secp256k1-src/src/scalar_impl.h:20:
../src/secp256k1-src/src/scalar_4x64_impl.h:83:12: warning: unused function 'secp256k1_scalar_add' [-Wunused-function]
static int secp256k1_scalar_add(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b) {
^
../src/secp256k1-src/src/scalar_4x64_impl.h:897:12: warning: unused function 'secp256k1_scalar_shr_int' [-Wunused-function]
static int secp256k1_scalar_shr_int(secp256k1_scalar *r, int n) {
^
In file included from ../src/privatekey.cc:4:
../src/secp256k1-src/src/scalar_impl.h:225:13: warning: unused function 'secp256k1_scalar_inverse_var' [-Wunused-function]
static void secp256k1_scalar_inverse_var(secp256k1_scalar *r, const secp256k1_scalar *x) {
^
In file included from ../src/privatekey.cc:4:
In file included from ../src/secp256k1-src/src/scalar_impl.h:20:
../src/secp256k1-src/src/scalar_4x64_impl.h:140:13: warning: unused function 'secp256k1_scalar_negate' [-Wunused-function]
static void secp256k1_scalar_negate(secp256k1_scalar *r, const secp256k1_scalar *a) {
^
../src/secp256k1-src/src/scalar_4x64_impl.h:156:12: warning: unused function 'secp256k1_scalar_is_high' [-Wunused-function]
static int secp256k1_scalar_is_high(const secp256k1_scalar *a) {
^
../src/secp256k1-src/src/scalar_4x64_impl.h:168:12: warning: unused function 'secp256k1_scalar_cond_negate' [-Wunused-function]
static int secp256k1_scalar_cond_negate(secp256k1_scalar *r, int flag) {
^
63 warnings generated.
CXX(target) Release/obj.target/secp256k1/src/publickey.o
CXX(target) Release/obj.target/secp256k1/src/signature.o
CXX(target) Release/obj.target/secp256k1/src/ecdsa.o
../src/ecdsa.cc:88:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
obj->Set(info.GetIsolate()->GetCurrentContext(), Nan::New<v8::String>("signature").ToLocalChecked(), COPY_BUFFER(&output[0], 64));
^~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/ecdsa.cc:89:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
obj->Set(info.GetIsolate()->GetCurrentContext(), Nan::New<v8::String>("recovery").ToLocalChecked(), Nan::New<v8::Number>(recid));
^~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
CXX(target) Release/obj.target/secp256k1/src/ecdh.o
CC(target) Release/obj.target/secp256k1/src/secp256k1-src/src/secp256k1.o
In file included from ../src/secp256k1-src/src/secp256k1.c:11:
../src/secp256k1-src/src/field_impl.h:266:13: warning: unused function 'secp256k1_fe_inv_all_var' [-Wunused-function]
static void secp256k1_fe_inv_all_var(secp256k1_fe *r, const secp256k1_fe *a, size_t len) {
^
In file included from ../src/secp256k1-src/src/secp256k1.c:13:
../src/secp256k1-src/src/group_impl.h:202:13: warning: unused function 'secp256k1_ge_set_infinity' [-Wunused-function]
static void secp256k1_ge_set_infinity(secp256k1_ge *r) {
^
../src/secp256k1-src/src/group_impl.h:691:12: warning: unused function 'secp256k1_gej_has_quad_y_var' [-Wunused-function]
static int secp256k1_gej_has_quad_y_var(const secp256k1_gej *a) {
^
../src/secp256k1-src/src/group_impl.h:272:12: warning: unused function 'secp256k1_gej_is_valid_var' [-Wunused-function]
static int secp256k1_gej_is_valid_var(const secp256k1_gej *a) {
^
In file included from ../src/secp256k1-src/src/secp256k1.c:14:
../src/secp256k1-src/src/ecmult_impl.h:1135:12: warning: unused function 'secp256k1_ecmult_multi_var' [-Wunused-function]
static int secp256k1_ecmult_multi_var(const secp256k1_ecmult_context *ctx, secp256k1_scratch *scratch, secp256k1_gej *r, const secp256k1_scalar *...
^
../src/secp256k1-src/src/ecmult_impl.h:669:12: warning: unused function 'secp256k1_ecmult_strauss_batch_single' [-Wunused-function]
static int secp256k1_ecmult_strauss_batch_single(const secp256k1_ecmult_context *actx, secp256k1_scratch *scratch, secp256k1_gej *r, const secp25...
^
../src/secp256k1-src/src/ecmult_impl.h:1042:12: warning: unused function 'secp256k1_ecmult_pippenger_batch_single' [-Wunused-function]
static int secp256k1_ecmult_pippenger_batch_single(const secp256k1_ecmult_context *actx, secp256k1_scratch *scratch, secp256k1_gej *r, const secp...
^
7 warnings generated.
CC(target) Release/obj.target/secp256k1/src/secp256k1-src/contrib/lax_der_parsing.o
CC(target) Release/obj.target/secp256k1/src/secp256k1-src/contrib/lax_der_privatekey_parsing.o
SOLINK_MODULE(target) Release/secp256k1.node
> sodium-native@3.2.0 install /Users/***/zilliqa-dapp/node_modules/sodium-native
> node-gyp-build "node preinstall.js" "node postinstall.js"
> utf-8-validate@5.0.2 install /Users/***/zilliqa-dapp/node_modules/utf-8-validate
> node-gyp-build
> protobufjs@6.10.1 postinstall /Users/***/zilliqa-dapp/node_modules/protobufjs
> node scripts/postinstall
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: scrypt@6.0.3 (node_modules/scrypt):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: scrypt@6.0.3 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
+ @zilliqa-js/zilliqa@1.0.0
added 68 packages from 87 contributors and audited 1881 packages in 59.475s
64 packages are looking for funding
run `npm fund` for details
found 2 vulnerabilities (1 low, 1 high)
run `npm audit fix` to fix them, or `npm audit` for details