bitpay / bitcore

A full stack for bitcoin and blockchain-based applications
https://bitcore.io/
MIT License
4.87k stars 2.09k forks source link

THE INSTALL GUIDE OUT TIME!!! AND I TRY MANY TIMES AND GET MANY ERRORS, JUST CAN NOT `NPM INSTALL` SUCCESS... #3250

Open Xiechengqi opened 3 years ago

Xiechengqi commented 3 years ago
# sudo npm install --unsafe-perm=true --allow-root
>  @8.25.8 postinstall /data/BTC/btc-index-8.25.12
> npm run bootstrap && npm run compile

> @8.25.8 bootstrap /data/BTC/btc-index-8.25.12
> lerna bootstrap

lerna notice cli v3.22.1
lerna info Bootstrapping 16 packages
lerna info Installing external dependencies
lerna ERR! npm install exited 1 in 'bitcore-node'
lerna ERR! npm install stdout:

> scrypt@6.0.3 preinstall /data/BTC/btc-index-8.25.12/packages/bitcore-node/node_modules/scrypt
> node node-scrypt-preinstall.js

> scrypt@6.0.3 install /data/BTC/btc-index-8.25.12/packages/bitcore-node/node_modules/scrypt
> node-gyp rebuild

make: Entering directory '/data/BTC/btc-index-8.25.12/packages/bitcore-node/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
scrypt.target.mk:131: recipe for target 'Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_async.o' failed
make: Leaving directory '/data/BTC/btc-index-8.25.12/packages/bitcore-node/node_modules/scrypt/build'

lerna ERR! npm install stderr:
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: warning: ‘v8::Local<v8::Value> v8::Object::Get(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
       N(obj->Get(Nan::New("N").ToLocalChecked())->Uint32Value()),
                                                ^
In file included from /root/.cache/node-gyp/12.16.0/include/node/v8-internal.h:14:0,
                 from /root/.cache/node-gyp/12.16.0/include/node/v8.h:27,
                 from /root/.cache/node-gyp/12.16.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/12.16.0/include/node/v8.h:3553:51: note: declared here
   V8_DEPRECATED("Use maybe version", Local<Value> Get(Local<Value> key));
                                                   ^
/root/.cache/node-gyp/12.16.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
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:39:63: error: no matching function for call to ‘v8::Value::Uint32Value()’
       N(obj->Get(Nan::New("N").ToLocalChecked())->Uint32Value()),
                                                               ^
In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/12.16.0/include/node/v8.h:2707:41: note: candidate: v8::Maybe<unsigned int> v8::Value::Uint32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
                                         ^~~~~~~~~~~
/root/.cache/node-gyp/12.16.0/include/node/v8.h:2707:41: note:   candidate expects 1 argument, 0 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: warning: ‘v8::Local<v8::Value> v8::Object::Get(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
       r(obj->Get(Nan::New("r").ToLocalChecked())->Uint32Value()),
                                                ^
In file included from /root/.cache/node-gyp/12.16.0/include/node/v8-internal.h:14:0,
                 from /root/.cache/node-gyp/12.16.0/include/node/v8.h:27,
                 from /root/.cache/node-gyp/12.16.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/12.16.0/include/node/v8.h:3553:51: note: declared here
   V8_DEPRECATED("Use maybe version", Local<Value> Get(Local<Value> key));
                                                   ^
/root/.cache/node-gyp/12.16.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
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:63: error: no matching function for call to ‘v8::Value::Uint32Value()’
       r(obj->Get(Nan::New("r").ToLocalChecked())->Uint32Value()),
                                                               ^
In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/12.16.0/include/node/v8.h:2707:41: note: candidate: v8::Maybe<unsigned int> v8::Value::Uint32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
                                         ^~~~~~~~~~~
/root/.cache/node-gyp/12.16.0/include/node/v8.h:2707:41: note:   candidate expects 1 argument, 0 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: warning: ‘v8::Local<v8::Value> v8::Object::Get(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
       p(obj->Get(Nan::New("p").ToLocalChecked())->Uint32Value()) {}
                                                ^
In file included from /root/.cache/node-gyp/12.16.0/include/node/v8-internal.h:14:0,
                 from /root/.cache/node-gyp/12.16.0/include/node/v8.h:27,
                 from /root/.cache/node-gyp/12.16.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/12.16.0/include/node/v8.h:3553:51: note: declared here
   V8_DEPRECATED("Use maybe version", Local<Value> Get(Local<Value> key));
                                                   ^
/root/.cache/node-gyp/12.16.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
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:63: error: no matching function for call to ‘v8::Value::Uint32Value()’
       p(obj->Get(Nan::New("p").ToLocalChecked())->Uint32Value()) {}
                                                               ^
In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/12.16.0/include/node/v8.h:2707:41: note: candidate: v8::Maybe<unsigned int> v8::Value::Uint32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
                                         ^~~~~~~~~~~
/root/.cache/node-gyp/12.16.0/include/node/v8.h:2707:41: note:   candidate expects 1 argument, 0 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 /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/12.16.0/include/node/v8.h:2704: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/12.16.0/include/node/v8.h:2704: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/12.16.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/12.16.0/include/node/v8.h:2704: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/12.16.0/include/node/v8.h:2704: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/12.16.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/12.16.0/include/node/v8.h:2705: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/12.16.0/include/node/v8.h:2705: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/12.16.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/12.16.0/include/node/v8.h:2705: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/12.16.0/include/node/v8.h:2705: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: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   obj->Set(Nan::New("N").ToLocalChecked(), Nan::New<Integer>(logN));
                                                                   ^
In file included from /root/.cache/node-gyp/12.16.0/include/node/v8-internal.h:14:0,
                 from /root/.cache/node-gyp/12.16.0/include/node/v8.h:27,
                 from /root/.cache/node-gyp/12.16.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/12.16.0/include/node/v8.h:3499:22: note: declared here
                 bool Set(Local<Value> key, Local<Value> value));
                      ^
/root/.cache/node-gyp/12.16.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/node-boilerplate/scrypt_params_async.cc:24:64: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   obj->Set(Nan::New("r").ToLocalChecked(), Nan::New<Integer>(r));
                                                                ^
In file included from /root/.cache/node-gyp/12.16.0/include/node/v8-internal.h:14:0,
                 from /root/.cache/node-gyp/12.16.0/include/node/v8.h:27,
                 from /root/.cache/node-gyp/12.16.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/12.16.0/include/node/v8.h:3499:22: note: declared here
                 bool Set(Local<Value> key, Local<Value> value));
                      ^
/root/.cache/node-gyp/12.16.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/node-boilerplate/scrypt_params_async.cc:25:64: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   obj->Set(Nan::New("p").ToLocalChecked(), Nan::New<Integer>(p));
                                                                ^
In file included from /root/.cache/node-gyp/12.16.0/include/node/v8-internal.h:14:0,
                 from /root/.cache/node-gyp/12.16.0/include/node/v8.h:27,
                 from /root/.cache/node-gyp/12.16.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/node-boilerplate/scrypt_params_async.cc:1:
/root/.cache/node-gyp/12.16.0/include/node/v8.h:3499:22: note: declared here
                 bool Set(Local<Value> key, Local<Value> value));
                      ^
/root/.cache/node-gyp/12.16.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../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 {
   ^~~~
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 (/data/node-12.16.0/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-1021-aws
gyp ERR! command "/data/node-12.16.0/bin/node" "/data/node-12.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /data/BTC/btc-index-8.25.12/packages/bitcore-node/node_modules/scrypt
gyp ERR! node -v v12.16.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN bitcore-node@8.25.12 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the scrypt@6.0.3 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!     /root/.npm/_logs/2021-08-23T07_26_40_810Z-debug.log

lerna ERR! npm install exited 1 in 'bitcore-node'
lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @8.25.8 bootstrap: `lerna bootstrap`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @8.25.8 bootstrap 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!     /root/.npm/_logs/2021-08-23T07_26_40_871Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @8.25.8 postinstall: `npm run bootstrap && npm run compile`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @8.25.8 postinstall 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!     /root/.npm/_logs/2021-08-23T07_26_40_917Z-debug.log

/root/.npm/_logs/2021-08-23T07_26_40_917Z-debug.log

...
25 silly install executeActions
26 silly doSerial global-install 0
27 verbose correctMkdir /root/.npm/_locks correctMkdir not in flight; initializing
28 verbose lock using /root/.npm/_locks/staging-b1b96737ba0b19ee.lock for /data/BTC/btc-index-8.25.12/node_modules/.staging
29 silly doParallel extract 0
30 silly doReverseSerial unbuild 0
31 silly doSerial remove 0
32 silly doSerial move 0
33 silly doSerial finalize 0
34 silly doParallel refresh-package-json 0
35 silly doParallel preinstall 0
36 silly doSerial build 0
37 silly doSerial global-link 0
38 silly doParallel update-linked 0
39 silly doSerial install 0
40 silly doSerial postinstall 0
41 verbose unlock done using /root/.npm/_locks/staging-b1b96737ba0b19ee.lock for /data/BTC/btc-index-8.25.12/node_modules/.staging
42 timing stage:executeActions Completed in 54ms
43 timing stage:rollbackFailedOptional Completed in 0ms
44 silly install runPostinstallTopLevelLifecycles
45 silly build @8.25.8
46 info linkStuff @8.25.8
47 silly linkStuff @8.25.8 has /data/BTC as its parent node_modules
48 silly install @8.25.8
49 info lifecycle @8.25.8~install: @8.25.8
50 silly postinstall @8.25.8
51 info lifecycle @8.25.8~postinstall: @8.25.8
52 verbose lifecycle @8.25.8~postinstall: unsafe-perm in lifecycle true
53 verbose lifecycle @8.25.8~postinstall: PATH: /data/node-12.16.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/data/BTC/btc-index-8.25.12/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
54 verbose lifecycle @8.25.8~postinstall: CWD: /data/BTC/btc-index-8.25.12
55 silly lifecycle @8.25.8~postinstall: Args: [ '-c', 'npm run bootstrap && npm run compile' ]
56 timing audit submit Completed in 286ms
57 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 286ms
58 timing audit body Completed in 2ms
59 silly lifecycle @8.25.8~postinstall: Returned: code: 1  signal: null
60 info lifecycle @8.25.8~postinstall: Failed to exec postinstall script
61 verbose stack Error: @8.25.8 postinstall: `npm run bootstrap && npm run compile`
61 verbose stack Exit status 1
61 verbose stack     at EventEmitter.<anonymous> (/data/node-12.16.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
61 verbose stack     at EventEmitter.emit (events.js:321:20)
61 verbose stack     at ChildProcess.<anonymous> (/data/node-12.16.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
61 verbose stack     at ChildProcess.emit (events.js:321:20)
61 verbose stack     at maybeClose (internal/child_process.js:1021:16)
61 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
62 verbose pkgid @8.25.8
63 verbose cwd /data/BTC/btc-index-8.25.12
64 verbose Linux 4.15.0-1021-aws
65 verbose argv "/data/node-12.16.0/bin/node" "/usr/bin/npm" "install" "--unsafe-perm=true" "--allow-root"
66 verbose node v12.16.0
67 verbose npm  v6.13.4
68 error code ELIFECYCLE
69 error errno 1
70 error @8.25.8 postinstall: `npm run bootstrap && npm run compile`
70 error Exit status 1
71 error Failed at the @8.25.8 postinstall script.
71 error This is probably not a problem with npm. There is likely additional logging output above.
72 verbose exit [ 1, true ]
kajoseph commented 3 years ago

@Xiechengqi Have you tried with Node v11? Currently, bitcore is known to throw errors for Node v12+

Xiechengqi commented 3 years ago

@Xiechengqi Have you tried with Node v11? Currently, bitcore is known to throw errors for Node v12+

https://github.com/Xiechengqi/scripts/blob/master/install/BTC/btc-index/install.sh

vadpert commented 3 years ago

This is what finally worked for me

delete bitcore - and redownload from git

nvm install v8.16.0

See: https://github.com/bitpay/bitcore/issues/3183 https://github.com/bitpay/bitcore/issues/2603

lingxiyizhi666 commented 2 years ago

I've got the whole btc and doge database by bitcore-node,if anyone want,I can afford it. Here is my email: lingxiyizhi666@outlook.com

Matthelonianxl commented 2 years ago

! /usr/bin/env python

#

Implementation of elliptic curves, for cryptographic applications.

#

This module doesn't provide any way to choose a random elliptic

curve, nor to verify that an elliptic curve was chosen randomly,

because one can simply use NIST's standard curves.

#

Notes from X9.62-1998 (draft):

Nomenclature:

- Q is a public key.

The "Elliptic Curve Domain Parameters" include:

- q is the "field size", which in our case equals p.

- p is a big prime.

- G is a point of prime order (5.1.1.1).

- n is the order of G (5.1.1.1).

Public-key validation (5.2.2):

- Verify that Q is not the point at infinity.

- Verify that X_Q and Y_Q are in [0,p-1].

- Verify that Q is on the curve.

- Verify that nQ is the point at infinity.

Signature generation (5.3):

- Pick random k from [1,n-1].

Signature checking (5.4.2):

- Verify that r and s are in [1,n-1].

#

Version of 2008.11.25.

#

Revision history:

2005.12.31 - Initial version.

2008.11.25 - Change CurveFp.is_on to contains_point.

#

Written in 2005 by Peter Pearson and placed in the public domain.

from future import division

from .six import print_ from . import numbertheory

class CurveFp( object ): """Elliptic Curve over the field of integers modulo a prime.""" def init( self, p, a, b ): """The curve of points satisfying y^2 = x^3 + a*x + b (mod p).""" self.p = p self.a = a self.__b = b

def p( self ): return self.__p

def a( self ): return self.__a

def b( self ): return self.__b

def contains_point( self, x, y ): """Is the point (x,y) on this curve?""" return ( y y - ( x x x + self.__a x + self.b ) ) % self.p == 0

class Point( object ): """A point on an elliptic curve. Altering x and y is forbidding, but they can be read by the x() and y() methods.""" def init( self, curve, x, y, order = None ): """curve, x, y, order; order (optional) is the order of this point.""" self.curve = curve self.x = x self.y = y self.order = order

self.curve is allowed to be None only for INFINITY:

if self.__curve: assert self.__curve.contains_point( x, y )
if order: assert self * order == INFINITY

def eq( self, other ): """Return True if the points are identical, False otherwise.""" if self.curve == other.curve \ and self.x == other.x \ and self.y == other.y: return True else: return False

def add( self, other ): """Add one point to another point."""

# X9.62 B.3:

if other == INFINITY: return self
if self == INFINITY: return other
assert self.__curve == other.__curve
if self.__x == other.__x:
  if ( self.__y + other.__y ) % self.__curve.p() == 0:
    return INFINITY
  else:
    return self.double()

p = self.__curve.p()

l = ( ( other.__y - self.__y ) * \
      numbertheory.inverse_mod( other.__x - self.__x, p ) ) % p

x3 = ( l * l - self.__x - other.__x ) % p
y3 = ( l * ( self.__x - x3 ) - self.__y ) % p

return Point( self.__curve, x3, y3 )

def mul( self, other ): """Multiply a point by an integer."""

def leftmost_bit( x ):
  assert x > 0
  result = 1
  while result <= x: result = 2 * result
  return result // 2

e = other
if self.__order: e = e % self.__order
if e == 0: return INFINITY
if self == INFINITY: return INFINITY
assert e > 0

# From X9.62 D.3.2:

e3 = 3 * e
negative_self = Point( self.__curve, self.__x, -self.__y, self.__order )
i = leftmost_bit( e3 ) // 2
result = self
# print_("Multiplying %s by %d (e3 = %d):" % ( self, other, e3 ))
while i > 1:
  result = result.double()
  if ( e3 & i ) != 0 and ( e & i ) == 0: result = result + self
  if ( e3 & i ) == 0 and ( e & i ) != 0: result = result + negative_self
  # print_(". . . i = %d, result = %s" % ( i, result ))
  i = i // 2

return result

def rmul( self, other ): """Multiply a point by an integer."""

return self * other

def str( self ): if self == INFINITY: return "infinity" return "(%d,%d)" % ( self.x, self.y )

def double( self ): """Return a new point that is twice the old."""

if self == INFINITY:
  return INFINITY

# X9.62 B.3:

p = self.__curve.p()
a = self.__curve.a()

l = ( ( 3 * self.__x * self.__x + a ) * \
      numbertheory.inverse_mod( 2 * self.__y, p ) ) % p

x3 = ( l * l - 2 * self.__x ) % p
y3 = ( l * ( self.__x - x3 ) - self.__y ) % p

return Point( self.__curve, x3, y3 )

def x( self ): return self.__x

def y( self ): return self.__y

def curve( self ): return self.__curve

def order( self ): return self.__order

This one point is the Point At Infinity for all purposes:

INFINITY = Point( None, None, None )

def main():

class FailedTest(Exception): pass def testadd( c, x1, y1, x2, y2, x3, y3 ): """We expect that on curve c, (x1,y1) + (x2, y2 ) = (x3, y3).""" p1 = Point( c, x1, y1 ) p2 = Point( c, x2, y2 ) p3 = p1 + p2 print("%s + %s = %s" % ( p1, p2, p3 ), end=' ') if p3.x() != x3 or p3.y() != y3: raise FailedTest("Failure: should give (%d,%d)." % ( x3, y3 )) else: print_(" Good.")

def testdouble( c, x1, y1, x3, y3 ): """We expect that on curve c, 2*(x1,y1) = (x3, y3).""" p1 = Point( c, x1, y1 ) p3 = p1.double() print("%s doubled = %s" % ( p1, p3 ), end=' ') if p3.x() != x3 or p3.y() != y3: raise FailedTest("Failure: should give (%d,%d)." % ( x3, y3 )) else: print_(" Good.")

def test_doubleinfinity( c ): """We expect that on curve c, 2*INFINITY = INFINITY.""" p1 = INFINITY p3 = p1.double() print("%s doubled = %s" % ( p1, p3 ), end=' ') if p3.x() != INFINITY.x() or p3.y() != INFINITY.y(): raise FailedTest("Failure: should give (%d,%d)." % ( INFINITY.x(), INFINITY.y() )) else: print_(" Good.")

def testmultiply( c, x1, y1, m, x3, y3 ): """We expect that on curve c, m(x1,y1) = (x3,y3).""" p1 = Point( c, x1, y1 ) p3 = p1 m print("%s * %d = %s" % ( p1, m, p3 ), end=' ') if p3.x() != x3 or p3.y() != y3: raise FailedTest("Failure: should give (%d,%d)." % ( x3, y3 )) else: print_(" Good.")

A few tests from X9.62 B.3:

c = CurveFp( 23, 1, 1 ) test_add( c, 3, 10, 9, 7, 17, 20 ) test_double( c, 3, 10, 7, 12 ) test_add( c, 3, 10, 3, 10, 7, 12 ) # (Should just invoke double.) test_multiply( c, 3, 10, 2, 7, 12 )

test_double_infinity(c)

From X9.62 I.1 (p. 96):

g = Point( c, 13, 7, 7 )

check = INFINITY for i in range( 7 + 1 ): p = ( i % 7 ) g print_("%s %d = %s, expected %s . . ." % ( g, i, p, check ), end=' ') if p == check: print_(" Good.") else: raise FailedTest("Bad.") check = check + g

NIST Curve P-192:

p = 6277101735386680763835789423207666416083908700390324961279 r = 6277101735386680763835789423176059013767194773182842284081

s = 0x3045ae6fc8422f64ed579528d38120eae12196d5L

c = 0x3099d2bbbfcb2538542dcd5fb078b6ef5f3d6fe2c745de65 b = 0x64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1 Gx = 0x188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012 Gy = 0x07192b95ffc8da78631011ed6b24cdd573f977a11e794811

c192 = CurveFp( p, -3, b ) p192 = Point( c192, Gx, Gy, r )

Checking against some sample computations presented

in X9.62:

d = 651056770906015076056810763456358567190100156695615665659 Q = d p192 if Q.x() != 0x62B12D60690CDCF330BABAB6E69763B471F994DD702D16A5: raise FailedTest("p192 d came out wrong.") else: print_("p192 * d came out right.")

k = 6140507067065001063065065565667405560006161556565665656654 R = k p192 if R.x() != 0x885052380FF147B734C330C43D39B2C4A89F29B0F749FEAD \ or R.y() != 0x9CF9FA1CBEFEFB917747A3BB29C072B9289C2547884FD835: raise FailedTest("k p192 came out wrong.") else: print_("k * p192 came out right.")

u1 = 2563697409189434185194736134579731015366492496392189760599 u2 = 6266643813348617967186477710235785849136406323338782220568 temp = u1 p192 + u2 Q if temp.x() != 0x885052380FF147B734C330C43D39B2C4A89F29B0F749FEAD \ or temp.y() != 0x9CF9FA1CBEFEFB917747A3BB29C072B9289C2547884FD835: raise FailedTest("u1 p192 + u2 Q came out wrong.") else: print_("u1 p192 + u2 Q came out right.")

if name == "main": main()