2015-07-21 111 views
0

我想安裝aerospike npm模塊v 1.0.21使用npm install [email protected]但是我收到一個半神祕的錯誤消息。我試過安裝Aerospike C庫的多個版本,並且有多個版本的節點(從0.10.22到0.10.38到最新)都沒有運氣。這是在OS X 10.9上。每個線程都建議安裝lua或使用不同版本的Aaerospike C庫。npm aerospike安裝問題

isaacs-computer:Desktop isaac$ npm install [email protected] 
/
> [email protected] 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! [email protected] install: `node-gyp rebuild` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] 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" "[email protected]" 
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 
+1

你想要版本1.0.21的任何特定原因?最新版本是1.0.47,對我來說安裝得很好(10.10.4),而1.0.21版本沒有(編譯問題)。 – robertklep

+1

我公司在生產中使用1.0.21。最新版的Aerospike也適合我。爲了測試,我已經將aerospike轉換爲1.0.27(最接近我可以編譯的1.0.21),但是我真的想知道爲什麼1.0.21沒有安裝,尤其是在1.0.21成功安裝了32天后以前當我上次運行npm install時。 – isaac9A

+1

它看起來像下載的客戶端根本沒有版本,這意味着它始終下載最新/當前版本的客戶端,它不一定與Node模塊期望的版本相匹配。 – robertklep

回答

1

您可以通過在你的機器上安裝C客戶機,並使用本地安裝的版本安裝塞客戶的NodeJS版本1.0.21繞過這個問題。以下是步驟。

  1. 從aerospike網站下載並安裝C客戶端版本3.0.86
  2. 做一個npm install [email protected]

這應該解決C客戶和客戶的NodeJS之間的版本依賴失敗。

+0

不起作用,因爲npm會自動下載用於編譯的最新版本的c客戶端。向aerospike提交了一份錯誤報告。 – isaac9A

1

如果你不能得到npm的工作,你總是可以從git克隆倉庫。