npm install Bitcore returns gyp build error

npm install Bitcore returns gyp build error

Here is my error when I tried to install bitcore client for insight API. It requires to use v4 of node and I am using version 4 by nvm install v4 and I have installed all the dependencies too including zeromq.

$ npm install -g bitcore-node@latest > bitcore-node@3.1.3 preinstall /home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/bitcore-node > ./scripts/download
Downloading bitcoin: https://github.com/bitpay/bitcoin/releases/download/v0.12.1-bitcore-4/bitcoin-0.12.1-linux64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   619    0   619    0     0    982      0 --:--:-- --:--:-- --:--:--   980
100 24.6M  100 24.6M    0     0  4795k      0  0:00:05  0:00:05 --:--:-- 6897k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   604    0   604    0     0    303      0 --:--:--  0:00:01 --:--:--   303
100  1154  100  1154    0     0    425      0  0:00:02  0:00:02 --:--:--  3214
Unpacking bitcoin distribution
bitcoin-0.12.1/
bitcoin-0.12.1/bin/
bitcoin-0.12.1/bin/bitcoin-cli
bitcoin-0.12.1/bin/bitcoind
bitcoin-0.12.1/bin/bitcoin-qt
bitcoin-0.12.1/bin/bitcoin-tx
bitcoin-0.12.1/bin/test_bitcoin
bitcoin-0.12.1/bin/wallet-utility
bitcoin-0.12.1/include/
bitcoin-0.12.1/include/bitcoinconsensus.h
bitcoin-0.12.1/lib/
bitcoin-0.12.1/lib/libbitcoinconsensus.so
bitcoin-0.12.1/lib/libbitcoinconsensus.so.0
bitcoin-0.12.1/lib/libbitcoinconsensus.so.0.0.0
| > utf-8-validate@1.2.2 install /home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/bitcore-node/node_modules/utf-8-validate > node-gyp rebuild
make: Entering directory '/home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/bitcore-node/node_modules/utf-8-validate/build'
  CXX(target) Release/obj.target/validation/src/validation.o
../src/validation.cc: In function 'int is_valid_utf8(size_t, char*)':
../src/validation.cc:81:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
       case 5 : ch += (uint8_t) value[i++]; ch <<= 6;
                                            ~~~^~~~~
../src/validation.cc:82:7: note: here
       case 4 : ch += (uint8_t) value[i++]; ch <<= 6;
       ^~~~
../src/validation.cc:82:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
       case 4 : ch += (uint8_t) value[i++]; ch <<= 6;
                                            ~~~^~~~~
../src/validation.cc:83:7: note: here
       case 3 : ch += (uint8_t) value[i++]; ch <<= 6;
       ^~~~
../src/validation.cc:83:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
       case 3 : ch += (uint8_t) value[i++]; ch <<= 6;
                                            ~~~^~~~~
../src/validation.cc:84:7: note: here
       case 2 : ch += (uint8_t) value[i++]; ch <<= 6;
       ^~~~
../src/validation.cc:84:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
       case 2 : ch += (uint8_t) value[i++]; ch <<= 6;
                                            ~~~^~~~~
../src/validation.cc:85:7: note: here
       case 1 : ch += (uint8_t) value[i++]; ch <<= 6;
       ^~~~
../src/validation.cc:85:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
       case 1 : ch += (uint8_t) value[i++]; ch <<= 6;
                                            ~~~^~~~~
../src/validation.cc:86:7: note: here
       case 0 : ch += (uint8_t) value[i];
       ^~~~
../src/validation.cc: In function 'int isLegalUTF8(const uint8_t*, int)':
../src/validation.cc:51:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
     case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0;
             ^~
../src/validation.cc:52:5: note: here
     case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0;
     ^~~~
../src/validation.cc:52:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
     case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0;
             ^~
../src/validation.cc:53:5: note: here
     case 2: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0;
     ^~~~
../src/validation.cc:59:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 0xF4: if (a > 0x8F) return 0;
                    ^~
../src/validation.cc:62:5: note: here
     case 1: if (*source >= 0x80 && *source < 0xC2) return 0;
     ^~~~
  SOLINK_MODULE(target) Release/obj.target/validation.node
  COPY Release/validation.node
make: Leaving directory '/home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/bitcore-node/node_modules/utf-8-validate/build'> bufferutil@1.2.1 install /home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/bitcore-node/node_modules/bufferutil > node-gyp rebuild make: Entering directory '/home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/bitcore-node/node_modules/bufferutil/build'
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
../src/bufferutil.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE BufferUtil::Mask(Nan::NAN_METHOD_ARGS_TYPE)':
../src/bufferutil.cc:102:39: warning: this statement may fall through [-Wimplicit-fallthrough=]
       case 3: *((unsigned char*)to+2) = *((unsigned char*)from+2) ^ *((unsigned char*)mask+2);
               ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/bufferutil.cc:103:7: note: here
       case 2: *((unsigned char*)to+1) = *((unsigned char*)from+1) ^ *((unsigned char*)mask+1);
       ^~~~
../src/bufferutil.cc:103:39: warning: this statement may fall through [-Wimplicit-fallthrough=]
       case 2: *((unsigned char*)to+1) = *((unsigned char*)from+1) ^ *((unsigned char*)mask+1);
               ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/bufferutil.cc:104:7: note: here
       case 1: *((unsigned char*)to  ) = *((unsigned char*)from  ) ^ *((unsigned char*)mask);
       ^~~~
../src/bufferutil.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE BufferUtil::Unmask(Nan::NAN_METHOD_ARGS_TYPE)':
../src/bufferutil.cc:77:41: warning: this statement may fall through [-Wimplicit-fallthrough=]
       case 3: *((unsigned char*)from+2) = *((unsigned char*)from+2) ^ ((unsigned char*)mask)[2];
               ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/bufferutil.cc:78:7: note: here
       case 2: *((unsigned char*)from+1) = *((unsigned char*)from+1) ^ ((unsigned char*)mask)[1];
       ^~~~
../src/bufferutil.cc:78:41: warning: this statement may fall through [-Wimplicit-fallthrough=]
       case 2: *((unsigned char*)from+1) = *((unsigned char*)from+1) ^ ((unsigned char*)mask)[1];
               ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/bufferutil.cc:79:7: note: here
       case 1: *((unsigned char*)from  ) = *((unsigned char*)from  ) ^ ((unsigned char*)mask)[0];
       ^~~~
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  COPY Release/bufferutil.node
make: Leaving directory '/home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/bitcore-node/node_modules/bufferutil/build' > zmq@2.15.3 install /home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/bitcore-node/node_modules/zmqv> node-gyp rebuild
make: Entering directory '/home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/bitcore-node/node_modules/zmq/build'
  CXX(target) Release/obj.target/zmq/binding.o
../binding.cc:28:10: fatal error: zmq.h: No such file or directory
 #include <zmq.h>
          ^~~~~~~ compilation terminated.
zmq.target.mk:96: recipe for target 'Release/obj.target/zmq/binding.o' failed
make: *** [Release/obj.target/zmq/binding.o] Error 1
make: Leaving directory '/home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/bitcore-node/node_modules/zmq/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:12)
gyp ERR! System Linux 4.15.0-39-generic
gyp ERR! command "/home/sapphire/.nvm/versions/node/v4.9.1/bin/node" "/home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/bitcore-node/node_modules/zmq
gyp ERR! node -v v4.9.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
npm ERR! Linux 4.15.0-39-generic
npm ERR! argv "/home/sapphire/.nvm/versions/node/v4.9.1/bin/node" "/home/sapphire/.nvm/versions/node/v4.9.1/bin/npm" "install" "-g" "bitcore-node@latest"
npm ERR! node v4.9.1
npm ERR! npm  v2.15.11
npm ERR! code ELIFECYCLE
npm ERR! zmq@2.15.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the zmq@2.15.3 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the zmq package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs zmq
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls zmq
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /home/sapphire/npm-debug.log
sapphire@sapphire-laptop:~$ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@4.9.1 | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/home/sapphire/.nvm/versions/node/v4.9.1/lib/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   '/home/sapphire/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/sapphire/.node-gyp/4.9.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/sapphire/.node-gyp/4.9.1',
gyp info spawn args   '-Dnode_gyp_dir=/home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/sapphire/.node-gyp/4.9.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/sapphire',
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: binding.gyp not found (cwd: /home/sapphire) while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/sapphire/.nvm/versions/node/v4.9.1/lib/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:12)
gyp ERR! System Linux 4.15.0-39-generic
gyp ERR! command "/home/sapphire/.nvm/versions/node/v4.9.1/bin/node" "/home/sapphire/.nvm/versions/node/v4.9.1/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/sapphire
gyp ERR! node -v v4.9.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
https://ift.tt/2AxqG3h

Comments

Popular posts from this blog

Bitcoin Core errors with database block

sendrawtransaction and txn-mempool-conflict