npm aerospike安装问题

时间:2015-07-21 17:52:39

标签: node.js npm aerospike

我正在尝试使用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

2 个答案:

答案 0 :(得分:1)

您可以通过在计算机中安装C客户端并使用本地安装的版本来安装aerospike nodejs客户端版本1.0.21来解决此问题。以下是步骤。

  1. 从aerospike网站下载并安装C客户端版本3.0.86
  2. 执行<html> <head></head> body> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : 'xxxxxxxxxxxx', status : true, cookie : true, xfbml : true }); FB.Event.subscribe('auth.authResponseChange', function(response) { if (response.status === 'connected') { testAPI(); } else if (response.status === 'not_authorized') { FB.login(); } else { FB.login(); } }); }; (function(d){ var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; ref.parentNode.insertBefore(js, ref); }(document)); function testAPI() { FB.api('/me', function(response) { console.log(response.name + '---'+response.email); }); } </script> <fb:login-button show-faces="true" width="200" max-rows="1" scope="public_profile,email"></fb:login-button> </body> </html>
  3. 这应解决C客户端和nodejs客户端之间的版本依赖性故障。

答案 1 :(得分:1)

如果你无法使用npm,你总是可以从git克隆存储库。