Next, I try to install couchbase node module via npm:
npm install couchbase --save
This completes successfully. However when I try to run my app (which works fine on my desktop Ubuntu) I get this error:
ubuntu@aws-box:~/project/$ node index.js
/home/ubuntu/project/node_modules/couchbase/lib/binding.js:16
throw e;
^
Error:
/home/ubuntu/project/node_modules/couchbase/prebuilt/win/x64/couchbase_impl.node: invalid ELF header
at Module.load (module.js:349:32)
at Function.Module._load (module.js:305:12)
at Module.require (module.js:357:17)
at require (module.js:373:17)
at bindings (/home/ubuntu/project/node_modules/couchbase/node_modules/bindings/bindings.js:74:15)
at tryLoadBinding (/home/ubuntu/project/node_modules/couchbase/lib/binding.js:13:31)
at Object. (/home/ubuntu/project/node_modules/couchbase/lib/binding.js:30:17)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:349:32)
I’ve made a patch that will stop it from erroring on the Windows binaries (http://review.couchbase.org/30889/). However, your system has an underlying issue that is causing it to fail to build the binary specific for your system. If you wouldn’t mind, pastebin’ing the npm install command output so I can take a look.
Is this what you needed? Please let me know if I can provide you with anything else. PS the OS is the Ubuntu server 12.04 that comes as an option on Amazon’s free tier EC2 server.
Ensure that node-gyp works from your command-line before installing Couchnode. From what I can see, you may not have node-gyp available on the command line which is causing your systems couchnode build to fail.
Would you be able to recommend something that I could try? I’m very new to node, and currently we are this one tiny step away from deploying the application. If I can’t get the couchbase API working, we’ll have to move to a different technology…
So, when you execute node-gyp --version from your command line it works fine? Also, where did you get node v0.11.10-pre? Perhaps you should try using v0.11.9 which is the latest version I’ve tested and know works.
That was the input from installing node-gyp like so npm install -g node-gyp. I initially installed node by downloading the linux 64bit package and running ‘make’ from nodejs.com. Is this the recommended place to get node from? I opted for downloading vs apt thinking that it’d be the latest working package… I’ll try removing it and installing from apt maybe…
Hello,
I finally have a working version - I have installed Bitnami’s Ubuntu+nodeJs image which has preconfigured node. Also, my friends have confirmed that installing via package managers yielded success. So, in conclusion - use package managers, because the latest build may not work for the given OS Thank you for your time.