在ubuntu上配置/构建couchnode时遇到问题

时间:2014-10-19 14:22:59

标签: node.js ubuntu couchbase node-gyp couchnode

我已经通过npm安装了两个nodejs和模块couchbase。还安装了couchbase, 我可以通过浏览器访问后端。

相同的server.js文件适用于Windows。

我已经安装了python 2.7。我错过了什么吗?

我得到了错误:

marcel@servermarcel:~/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

2 个答案:

答案 0 :(得分:4)

我有类似的问题。原来沙发基地尝试运行

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

但是在Ubuntu 14.04上通过apt-get nodejs安装了节点。我把它改成了

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

node_modules/couchbase/binding.gyp文件中(靠近底部),然后运行npm rebuild(来自我的项目目录)并且它有效。

答案 1 :(得分:0)

我有同样的错误,但是节点-e - &gt;如上所述nodejs -e替换并没有解决问题。在对//node_modules/couchbase/builderror.log进行更多调查之后,期望的python版本是&gt; 2.5&lt; 3.0(我有一个Windows框)。 所以卸载了python 3.4.x并安装了2.7.9。 这解决了我的问题!!