celo-org / celo-monorepo

Official repository for core projects comprising the Celo platform
https://celo.org
Apache License 2.0
684 stars 360 forks source link

Contract Kit fails to install on node > 10 #2824

Closed H34D closed 4 years ago

H34D commented 4 years ago

Expected Behavior

Contract Kit works on all different node versions above 8 like written in the readme:

https://github.com/celo-org/celo-monorepo/blob/master/packages/contractkit/README.md#getting-started

Current Behavior

It only works on 10. If i go to 12 or 13 it fails with this error.

Sending build context to Docker daemon  1.895MB
Step 1/11 : FROM node:13.8
13.8: Pulling from library/node
3192219afd04: Already exists 
17c160265e75: Already exists 
cc4fe40d0e61: Already exists 
9d647f502a07: Already exists 
c8bd59397b26: Already exists 
f9289dfd19be: Already exists 
9553b08b6292: Pull complete 
37581b1ce15a: Pull complete 
45ea08f1ad05: Pull complete 
Digest: sha256:2b5a38ec24ad4f35c225e8ee80f9ca4133ed32b93fd666cd3804d1eeaa0d6dd5
Status: Downloaded newer image for node:13.8
 ---> 07e774543bdf
Step 2/11 : ADD . /celostats-server
 ---> 34781c5adb87
Step 3/11 : WORKDIR /celostats-server
 ---> Running in 4fd9651b8a00
Removing intermediate container 4fd9651b8a00
 ---> 7eb9dbc01ed4
Step 4/11 : ENV NODE_ENV=production
 ---> Running in a21e46c183e3
Removing intermediate container a21e46c183e3
 ---> 75ec205ae72a
Step 5/11 : RUN yarn
 ---> Running in 3fb64ab14f21
yarn install v1.21.1
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
warning sha.js@2.4.11: Invalid bin entry for "sha.js" (in "sha.js").
info fsevents@2.1.2: The platform "linux" is incompatible with this module.
info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
[5/5] Building fresh packages...
error /celostats-server/node_modules/scrypt: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /celostats-server/node_modules/scrypt
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.5
gyp info using node@13.8.0 | linux | x64
gyp info find Python using Python version 2.7.13 found at "/usr/bin/python"
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/celostats-server/node_modules/scrypt/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.cache/node-gyp/13.8.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/13.8.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/13.8.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/celostats-server/node_modules/scrypt',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/celostats-server/node_modules/scrypt/build'
  SOLINK_MODULE(target) Release/obj.target/copied_files.node
  COPY 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
  AR(target) Release/obj.target/scrypt_wrapper.a
  COPY 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
  AR(target) Release/obj.target/scrypt_lib.a
  COPY 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/inc/scrypt_async.h:28:0,
                 from ../src/node-boilerplate/inc/scrypt_params_async.h:28,
                 from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_common.h: In constructor 'NodeScrypt::Params::Params(const v8::Local<v8::Object>&)':
../src/node-boilerplate/inc/scrypt_common.h:39:48: error: no matching function for call to 'v8::Object::Get(v8::Local<v8::String>)'
       N(obj->Get(Nan::New("N").ToLocalChecked())->Uint32Value()),
                                                ^
In file included from /root/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:54,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3594:43: note: candidate: v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3594:43: note:   candidate expects 2 arguments, 1 provided
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3597:43: note: candidate: v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3597:43: note:   candidate expects 2 arguments, 1 provided
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:0,
                 from ../src/node-boilerplate/inc/scrypt_params_async.h:28,
                 from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_common.h:40:48: error: no matching function for call to 'v8::Object::Get(v8::Local<v8::String>)'
       r(obj->Get(Nan::New("r").ToLocalChecked())->Uint32Value()),
                                                ^
In file included from /root/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:54,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3594:43: note: candidate: v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3594:43: note:   candidate expects 2 arguments, 1 provided
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3597:43: note: candidate: v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3597:43: note:   candidate expects 2 arguments, 1 provided
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:0,
                 from ../src/node-boilerplate/inc/scrypt_params_async.h:28,
                 from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_common.h:41:48: error: no matching function for call to 'v8::Object::Get(v8::Local<v8::String>)'
       p(obj->Get(Nan::New("p").ToLocalChecked())->Uint32Value()) {}
                                                ^
In file included from /root/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:54,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3594:43: note: candidate: v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3594:43: note:   candidate expects 2 arguments, 1 provided
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3597:43: note: candidate: v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3597:43: note:   candidate expects 2 arguments, 1 provided
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:0,
                 from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_async.h: In member function 'virtual void ScryptAsyncWorker::HandleErrorCallback()':
../src/node-boilerplate/inc/scrypt_async.h:53:29: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
       callback->Call(1, argv);
                             ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:1:0:
../../nan/nan.h:1740:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:0:
../src/node-boilerplate/inc/scrypt_params_async.h: In constructor 'ScryptParamsAsyncWorker::ScryptParamsAsyncWorker(Nan::NAN_METHOD_ARGS_TYPE)':
../src/node-boilerplate/inc/scrypt_params_async.h:35:36: error: no matching function for call to 'v8::Value::NumberValue()'
       maxtime(info[0]->NumberValue()),
                                    ^
In file included from /root/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:54,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/13.8.0/include/node/v8.h:2773:39: note: candidate: v8::Maybe<double> v8::Value::NumberValue(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
                                       ^~~~~~~~~~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:2773:39: note:   candidate expects 1 argument, 0 provided
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:0:
../src/node-boilerplate/inc/scrypt_params_async.h:36:39: error: no matching function for call to 'v8::Value::NumberValue()'
       maxmemfrac(info[1]->NumberValue()),
                                       ^
In file included from /root/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:54,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/13.8.0/include/node/v8.h:2773:39: note: candidate: v8::Maybe<double> v8::Value::NumberValue(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
                                       ^~~~~~~~~~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:2773:39: note:   candidate expects 1 argument, 0 provided
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:0:
../src/node-boilerplate/inc/scrypt_params_async.h:37:36: error: no matching function for call to 'v8::Value::IntegerValue()'
       maxmem(info[2]->IntegerValue()),
                                    ^
In file included from /root/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:54,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/13.8.0/include/node/v8.h:2774:40: note: candidate: v8::Maybe<long int> v8::Value::IntegerValue(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
                                        ^~~~~~~~~~~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:2774:40: note:   candidate expects 1 argument, 0 provided
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:0:
../src/node-boilerplate/inc/scrypt_params_async.h:38:39: error: no matching function for call to 'v8::Value::IntegerValue()'
       osfreemem(info[3]->IntegerValue())
                                       ^
In file included from /root/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:54,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/13.8.0/include/node/v8.h:2774:40: note: candidate: v8::Maybe<long int> v8::Value::IntegerValue(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
                                        ^~~~~~~~~~~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:2774:40: note:   candidate expects 1 argument, 0 provided
../src/node-boilerplate/scrypt_params_async.cc: In member function 'virtual void ScryptParamsAsyncWorker::HandleOKCallback()':
../src/node-boilerplate/scrypt_params_async.cc:23:67: error: no matching function for call to 'v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)'
   obj->Set(Nan::New("N").ToLocalChecked(), Nan::New<Integer>(logN));
                                                                   ^
In file included from /root/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:54,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3547:37: note: candidate: v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3547:37: note:   candidate expects 3 arguments, 2 provided
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3550:37: note: candidate: v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                     ^~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3550:37: note:   candidate expects 3 arguments, 2 provided
../src/node-boilerplate/scrypt_params_async.cc:24:64: error: no matching function for call to 'v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)'
   obj->Set(Nan::New("r").ToLocalChecked(), Nan::New<Integer>(r));
                                                                ^
In file included from /root/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:54,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3547:37: note: candidate: v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3547:37: note:   candidate expects 3 arguments, 2 provided
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3550:37: note: candidate: v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                     ^~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3550:37: note:   candidate expects 3 arguments, 2 provided
../src/node-boilerplate/scrypt_params_async.cc:25:64: error: no matching function for call to 'v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)'
   obj->Set(Nan::New("p").ToLocalChecked(), Nan::New<Integer>(p));
                                                                ^
In file included from /root/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:54,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3547:37: note: candidate: v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3547:37: note:   candidate expects 3 arguments, 2 provided
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3550:37: note: candidate: v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                     ^~~
/root/.cache/node-gyp/13.8.0/include/node/v8.h:3550:37: note:   candidate expects 3 arguments, 2 provided
../src/node-boilerplate/scrypt_params_async.cc:32:25: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
   callback->Call(2, argv);
                         ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:1:0:
../../nan/nan.h:1740:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
scrypt.target.mk:131: recipe for target 'Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_async.o' failed
make: Leaving directory '/celostats-server/node_modules/scrypt/build'
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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 4.19.76-linuxkit
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /celostats-server/node_modules/scrypt
gyp ERR! node -v v13.8.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
The command '/bin/sh -c yarn' returned a non-zero code: 1
H34D commented 4 years ago

@gastonponti i got it to install with:

  "resolutions": {
    "@celo/contractkit/web3": "^1.2.6"
  },
H34D commented 4 years ago

@gastonponti i got it to install with:

  "resolutions": {
    "@celo/contractkit/web3": "^1.2.6"
  },

it will install but will not work. I got it working with:

  "resolutions": {
    "@celo/contractkit/eth-lib/keccakjs/sha3": "^1.2.3",
    "@celo/contractkit/web3/web3-eth/web3-eth-accounts/scrypt.js": "^0.3.0"
  },
gastonponti commented 4 years ago

Great! I'm linking this issue with #2603 that will fix it for master

H34D commented 4 years ago

Great! I'm linking this issue with #2603 that will fix it for master

amazing, thanks

H34D commented 4 years ago

closed with https://github.com/celo-org/celo-monorepo/issues/2603