npm aerospike 安装问题

npm aerospike install issue

我正在尝试使用 npm install aerospike@1.0.21 安装 aerospike npm 模块 v 1.0.21,但是我收到一条半神秘的错误消息。我尝试安装多个版本的 Aerospike C 库,以及多个版本的节点(从 0.10.22 到 0.10.38 到最新版本),但没有成功。这是 os x 10.9。每个线程都建议安装 lua 或使用不同版本的 Aaerospike C 库。

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

您可以通过在您的机器上安装C客户端并使用本地安装的版本安装aerospike nodejs客户端1.0.21版本来规避这个问题。以下是步骤。

  1. 从 aerospike 网站下载并安装 C 客户端版本 3.0.86
  2. 做一个npm install aerospike@1.0.21

这应该可以解决C客户端和nodejs客户端之间的版本依赖失败。

提交了 Aerospike 错误报告,已在 aerospike@1.0.27 中修复。说服我的公司更新到 1.0.27

如果您无法让 npm 正常工作,您可以随时从 git.

克隆存储库