5

I have installed both nodejs, and the module couchbase via npm. couchbase is installed too, and I can access to the backend via the browser.

The same server.js file does work on windows.

I have installed python 2.7. am I missing something?

Im getting the Error:

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)

when I look into the builderror.log I see:

$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
Rick77
  • 3,121
  • 25
  • 43
InsOp
  • 2,425
  • 3
  • 27
  • 42
  • Hi! This post might be more fit for the superuser site, where you might have more luck (I think it's a borderline situation, though, as the error deals with java exceptions as well) – Rick77 Oct 19 '14 at 14:34

2 Answers2

5

I had a similar issue. Turns out couchbase tries to run

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

However on Ubuntu 14.04 with node installed through apt-get it's nodejs. I changed it to

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

in node_modules/couchbase/binding.gyp file (near the bottom), then ran npm rebuild (from my project directory) and it worked.

thefourtheye
  • 233,700
  • 52
  • 457
  • 497
JaySilk84
  • 960
  • 7
  • 19
  • thank you very much, sir! this solved my problem. had another problem then which was easily solved with [link](http://stackoverflow.com/questions/24698159/error-connecting-to-couchbase-from-node-js-using-couchnode-module-v-1-2-4) – InsOp Oct 26 '14 at 19:11
0

I had the same error, however node -e -> nodejs -e replacement as mentioned above did NOT fix the problem. Upon more investigation into //node_modules/couchbase/builderror.log, python version expected was >2.5 and <3.0 (I have a windows box). So uninstalled python 3.4.x and installed 2.7.9. This fixed the problem for me !!

machzqcq
  • 1,029
  • 13
  • 15