0

I am trying to install aerospike npm module v 1.0.21 using npm install aerospike@1.0.21 however I get a semi-cryptic error message. I have tried installing multiple versions of the Aerospike C Library, and multiple versions of node (ranging from 0.10.22 to 0.10.38 to latest) with no luck. This is on os x 10.9. Every thread suggested installing lua or using different versions of the Aaerospike C Library.

isaacs-computer:Desktop isaac$ npm install aerospike@1.0.21
/
> aerospike@1.0.21 install /Users/isaac/Desktop/node_modules/aerospike
> node-gyp rebuild

  ACTION binding_gyp_aerospike_client_c_target_run_scripts_aerospike_client_c_sh aerospike-client-c/lib/libaerospike.a
info: downloading 'http://www.aerospike.com/download/client/c/latest/artifact/mac' to '/Users/isaac/Desktop/node_modules/aerospike/aerospike-client-c/package/aerospike-client-c.tgz'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   344  100   344    0     0    548      0 --:--:-- --:--:-- --:--:--   548
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   346  100   346    0     0    420      0 --:--:-- --:--:-- --:--:--   420
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 16.7M  100 16.7M    0     0  1900k      0  0:00:09  0:00:09 --:--:-- 3144k
info: extracting 'aerospike-client-c-3.1.18.mac.x86_64/aerospike-client-c-devel-3.1.18.pkg' from 'aerospike-client-c.tgz'
info: extracting files from 'aerospike-client-c-3.1.18.mac.x86_64/aerospike-client-c-devel-3.1.18.pkg'
8173 blocks

CHECK
   [✓] /Users/isaac/Desktop/node_modules/aerospike/aerospike-client-c/package/usr/local/lib/libaerospike.a
   [✓] /Users/isaac/Desktop/node_modules/aerospike/aerospike-client-c/package/usr/local/include/aerospike/aerospike.h
   [✓] /Users/isaac/Desktop/node_modules/aerospike/aerospike-client-c/package/usr/local/aerospike/client/sys/udf/lua/aerospike.lua

  TOUCH Release/obj.target/aerospike-client-c.stamp
  CXX(target) Release/obj.target/aerospike/src/main/aerospike.o
  CXX(target) Release/obj.target/aerospike/src/main/client.o
In file included from ../src/main/client.cc:27:
In file included from ../src/main/util/conversions.h:30:
../aerospike-client-c/include/aerospike/aerospike_batch.h:193:9: error: cannot
      initialize return object of type 'as_batch_read_record *' (aka
      'as_batch_read_record_s *') with an rvalue of type 'void *'
        return as_vector_reserve(&records->list);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/aerospike/src/main/client.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:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Darwin 13.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/isaac/Desktop/node_modules/aerospike
gyp ERR! node -v v0.10.38
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok 

npm ERR! aerospike@1.0.21 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the aerospike@1.0.21 install script.
npm ERR! This is most likely a problem with the aerospike 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 their info via:
npm ERR!     npm owner ls aerospike
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.4.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "aerospike@1.0.21"
npm ERR! cwd /Users/isaac/Desktop
npm ERR! node -v v0.10.38
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
isaac9A
  • 903
  • 4
  • 12
  • 30
  • 1
    Any particular reason you want version 1.0.21? The latest is 1.0.47, which installs fine for me (10.10.4), whereas 1.0.21 does not (compile issues too). – robertklep Jul 21 '15 at 18:43
  • 1
    My company uses 1.0.21 in production. The latest version of aerospike compiles fine for me too. For testing I have switch aerospike to 1.0.27 (the closest to 1.0.21 I could get to compile), however I would really like to figure out why 1.0.21 isn't installing, especially since 1.0.21 successfully installed 32 days ago when I last ran npm install. – isaac9A Jul 21 '15 at 19:49
  • 1
    It looks like the client that's being downloaded isn't versioned at all, which means that it always downloads the latest/current version of the client which doesn't necessarily match the version the Node module is expecting. – robertklep Jul 21 '15 at 20:59
  • 2
    @robertklep is correct. Only starting at version 1.0.27, is the node client tied to specific C version. This is the reason. – Wei-Ling Chu Jul 22 '15 at 01:18

3 Answers3

1

You can circumvent this problem by installing the C client in your machine and using the locally installed version to install aerospike nodejs Client version 1.0.21. Here are the steps.

  1. Download and install C client version 3.0.86 from aerospike website.
  2. do an npm install aerospike@1.0.21

This should solve the version dependency failure between C client and nodejs Client.

Gayathri
  • 121
  • 2
  • doesn't work because npm automatically downloads the latest version of the c client to use in compiling. Filed a bug report to aerospike. – isaac9A Aug 26 '15 at 20:40
1

Filed a bug report with Aerospike, fixed in aerospike@1.0.27. Convinced my company to update to 1.0.27

isaac9A
  • 903
  • 4
  • 12
  • 30
1

If you can't get npm working you can always clone the repository from git.

Ben Bates
  • 707
  • 3
  • 7