2014-10-19 48 views
4

我已經安裝了兩個nodejs和通過npm的模塊couchbase。 couchbase也被安裝, ,我可以通過瀏覽器訪問後端。在ubuntu上配置/建立couchnode的問題

相同的server.js文件在Windows上工作。

我已經安裝了python 2.7。我錯過了什麼嗎?

即時得到錯誤:

[email protected]:~/game$ nodejs server.js 

/home/marcel/game/node_modules/couchbase/lib/binding.js:156 
    throw new Error('Failed to locate couchnode native binding' + 
     ^
Error: Failed to locate couchnode native binding (maybe check builderror.log!) 
    at Object.<anonymous> (/home/marcel/game/node_modules/couchbase/lib/binding.js:156:9) 
    at Module._compile (module.js:456:26) 
    at Object.Module._extensions..js (module.js:474:10) 
    at Module.load (module.js:356:32) 
    at Function.Module._load (module.js:312:12) 
    at Module.require (module.js:364:17) 
    at require (module.js:380:17) 
    at Object.<anonymous> (/home/marcel/game/node_modules/couchbase/lib/couchbase.js:3:15) 
    at Module._compile (module.js:456:26) 
    at Object.Module._extensions..js (module.js:474:10) 

當我看進builderror.log我看到:

$all to 'node -e "require('nan')"' returned exit status 1.le 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 (/usr/share/node-gyp/lib/configure.$ 
gyp ERR! stack  at ChildProcess.EventEmitter.emit (events.js:98:17) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (child_process.js:797$ 
gyp ERR! System Linux 3.13.0-36-generic 
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild" 
gyp ERR! cwd /home/marcel/game/node_modules/couchbase 
gyp ERR! node -v v0.10.25 
gyp ERR! node-gyp -v v0.10.10 
gyp ERR! not ok 
+0

嗨!這篇文章可能更適合超級用戶網站,在那裏你可能會有更多的運氣(我認爲這是一種邊緣情況,但是,由於錯誤也會涉及到java異常) – Rick77 2014-10-19 14:34:34

回答

4

我有一個類似的問題。原來couchbase嘗試運行

node -e "require(\'nan\')" 

不過在Ubuntu 14.04與通過安裝節點易於得到它的nodejs。我把它改成

nodejs -e "require(\'nan\')" 

node_modules/couchbase/binding.gyp文件(接近底部),然後跑npm rebuild(從我的項目目錄)和它的工作。

+0

非常感謝,先生!這解決了我的問題。有另一個問題,然後很容易解決[鏈接](http://stackoverflow.com/questions/24698159/error-connecting-to-couchbase-from-node-js-using-couchnode-module-v-1-2 -4) – InsOp 2014-10-26 19:11:28

+0

謝謝,這解決了這個問題。 – thefourtheye 2015-02-20 06:40:03

+0

謝謝男人。這個對我有用。 – 2015-07-31 13:28:36

0

我有同樣的錯誤,但是上面提到的節點-e - > nodejs -e替換沒有解決問題。經過對//node_modules/couchbase/builderror.log的進一步調查,python版本預計是> 2.5和< 3.0(我有一個windows框)。 因此卸載了python 3.4.x並安裝了2.7.9。 這解決了我的問題!