Web3.js: [email protected] installation error

Created on 9 Mar 2020  ·  7Comments  ·  Source: ChainSafe/web3.js

I am having problems installing Ethereum web3 on Ubuntu 18.04.4, it needs [email protected] which fails. My node version is v13.8.0

I've looked on stackoverflow, there is similar but not identical. Below is the output of npm install [email protected]

$ npm install [email protected]

> [email protected] preinstall /home/ubuntu/Project/node-code/node_modules/scrypt
> node node-scrypt-preinstall.js


> [email protected] install /home/ubuntu/Project/node-code/node_modules/scrypt
> node-gyp rebuild

make: Entering directory '/home/ubuntu/Project/node-code/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 /home/ubuntu/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/home/ubuntu/.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,
                                           ^~~
/home/ubuntu/.cache/node-gyp/13.8.0/include/node/v8.h:3594:43: note:   candidate expects 2 arguments, 1 provided
/home/ubuntu/.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,
                                           ^~~
/home/ubuntu/.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 /home/ubuntu/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/home/ubuntu/.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,
                                           ^~~
/home/ubuntu/.cache/node-gyp/13.8.0/include/node/v8.h:3594:43: note:   candidate expects 2 arguments, 1 provided
/home/ubuntu/.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,
                                           ^~~
/home/ubuntu/.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 /home/ubuntu/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/home/ubuntu/.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,
                                           ^~~
/home/ubuntu/.cache/node-gyp/13.8.0/include/node/v8.h:3594:43: note:   candidate expects 2 arguments, 1 provided
/home/ubuntu/.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,
                                           ^~~
/home/ubuntu/.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:1674: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 /home/ubuntu/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/home/ubuntu/.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;
                                       ^~~~~~~~~~~
/home/ubuntu/.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 /home/ubuntu/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/home/ubuntu/.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;
                                       ^~~~~~~~~~~
/home/ubuntu/.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 /home/ubuntu/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/home/ubuntu/.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(
                                        ^~~~~~~~~~~~
/home/ubuntu/.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 /home/ubuntu/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/home/ubuntu/.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(
                                        ^~~~~~~~~~~~
/home/ubuntu/.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 /home/ubuntu/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/home/ubuntu/.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,
                                     ^~~
/home/ubuntu/.cache/node-gyp/13.8.0/include/node/v8.h:3547:37: note:   candidate expects 3 arguments, 2 provided
/home/ubuntu/.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,
                                     ^~~
/home/ubuntu/.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 /home/ubuntu/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/home/ubuntu/.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,
                                     ^~~
/home/ubuntu/.cache/node-gyp/13.8.0/include/node/v8.h:3547:37: note:   candidate expects 3 arguments, 2 provided
/home/ubuntu/.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,
                                     ^~~
/home/ubuntu/.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 /home/ubuntu/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/home/ubuntu/.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,
                                     ^~~
/home/ubuntu/.cache/node-gyp/13.8.0/include/node/v8.h:3547:37: note:   candidate expects 3 arguments, 2 provided
/home/ubuntu/.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,
                                     ^~~
/home/ubuntu/.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:1674: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: *** [Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_async.o] Error 1
make: Leaving directory '/home/ubuntu/Project/node-code/node_modules/scrypt/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/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.15.0-1060-aws
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ubuntu/Project/node-code/node_modules/scrypt
gyp ERR! node -v v13.8.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install 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!     /home/ubuntu/.npm/_logs/2020-03-09T11_15_17_997Z-debug.log

Most helpful comment

in case someone stumbles upon this from google: you need to use the latest commit from node-scrypt which has a fix for node v12 support. Owner of the repo struggles with updating NPM package.

npm install github:barrysteyn/node-scrypt#fb60a8d3c158fe115a624b5ffa7480f3a24b03fb

All 7 comments

If you do npm i web3 it installs scrypt in some other way, which still gives a different error, but which appears just to be advisory, so I think it's probably ok.

I dont know why but it did, eventually after doing npm i web3 and re-runing the commands to update the npm it eventually solved the problem! 48 hours with this problem and it's finally solved... wow thanks

in case someone stumbles upon this from google: you need to use the latest commit from node-scrypt which has a fix for node v12 support. Owner of the repo struggles with updating NPM package.

npm install github:barrysteyn/node-scrypt#fb60a8d3c158fe115a624b5ffa7480f3a24b03fb

in case someone stumbles upon this from google: you need to use the latest commit from node-scrypt which has a fix for node v12 support. Owner of the repo struggles with updating NPM package.

npm install github:barrysteyn/node-scrypt#fb60a8d3c158fe115a624b5ffa7480f3a24b03fb

omg ty

Spent some time: updated Xcode, installed command-line tools, restarted the machine...

NVM is your friend

https://github.com/nvm-sh/nvm

nvm install 10

nvm use 10

Spent some time: updated Xcode, installed command-line tools, restarted the machine...

NVM is your friend

https://github.com/nvm-sh/nvm

nvm install 10

nvm use 10

environment
node: v14.15.3
npm: 6.14.9

I confirm that I managed to npm install inside a repository that had a dependency on [email protected] without the mentioned error..
what I did was:
npm cache clean -f
rm -rf node_modules
rm package-lock.json
npm install github:barrysteyn/node-scrypt#fb60a8d3c158fe115a624b5ffa7480f3a24b03fb as mentioned earlier
npm install to install the rest of the dependencies

in case someone stumbles upon this from google: you need to use the latest commit from node-scrypt which has a fix for node v12 support. Owner of the repo struggles with updating NPM package.

npm install github:barrysteyn/node-scrypt#fb60a8d3c158fe115a624b5ffa7480f3a24b03fb

Thank you, it worked 😍

Was this page helpful?
0 / 5 - 0 ratings