Node.js Couchbase SDK not building


#1

I am attempting to write my first javascript client for couchbase on Mac OSX 10.10.5. It appears the couchbase SDK is unable to be built as I get the following error:

build errors (/Users/Eric/node_modules/couchbase/lib/…/builderror.log):

…/src/cas.cc:69:10: error: no member named ‘SetIndexedPropertiesToExternalArrayData’ in 'v8::Object’
ret->SetIndexedPropertiesToExternalArrayData(
~~~ ^
…/src/cas.cc:70:16: error: no member named ‘kExternalUnsignedIntArray’ in namespace 'v8’
p, v8::kExternalUnsignedIntArray, 2);
~~~~^
…/src/cas.cc:88:18: error: no member named ‘GetIndexedPropertiesExternalArrayDataLength’ in 'v8::Object’
if (realObj->GetIndexedPropertiesExternalArrayDataLength() != 2) {
~~~~~~~ ^
…/src/cas.cc:91:31: error: no member named ‘GetIndexedPropertiesExternalArrayData’ in ‘v8::Object’
*p = (uint64_t)realObj->GetIndexedPropertiesExternalArrayData();
~~~~~~~ ^
4 errors generated.
make: *** [Release/obj.target/couchbase_impl/src/cas.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:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” "rebuild"
gyp ERR! cwd /Users/Eric/node_modules/couchbase
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok


load exceptions:

couchbase_impl:
{ [Error: Could not locate the bindings file. Tried:
→ /Users/Eric/node_modules/couchbase/build/couchbase_impl.node
→ /Users/Eric/node_modules/couchbase/build/Debug/couchbase_impl.node
→ /Users/Eric/node_modules/couchbase/build/Release/couchbase_impl.node
→ /Users/Eric/node_modules/couchbase/out/Debug/couchbase_impl.node
→ /Users/Eric/node_modules/couchbase/Debug/couchbase_impl.node
→ /Users/Eric/node_modules/couchbase/out/Release/couchbase_impl.node
→ /Users/Eric/node_modules/couchbase/Release/couchbase_impl.node
→ /Users/Eric/node_modules/couchbase/build/default/couchbase_impl.node
→ /Users/Eric/node_modules/couchbase/compiled/4.0.0/darwin/x64/couchbase_impl.node]
tries:
[ ‘/Users/Eric/node_modules/couchbase/build/couchbase_impl.node’,
’/Users/Eric/node_modules/couchbase/build/Debug/couchbase_impl.node’,
’/Users/Eric/node_modules/couchbase/build/Release/couchbase_impl.node’,
’/Users/Eric/node_modules/couchbase/out/Debug/couchbase_impl.node’,
’/Users/Eric/node_modules/couchbase/Debug/couchbase_impl.node’,
’/Users/Eric/node_modules/couchbase/out/Release/couchbase_impl.node’,
’/Users/Eric/node_modules/couchbase/Release/couchbase_impl.node’,
’/Users/Eric/node_modules/couchbase/build/default/couchbase_impl.node’,
’/Users/Eric/node_modules/couchbase/compiled/4.0.0/darwin/x64/couchbase_impl.node’ ] }

/Users/Eric/node_modules/couchbase/lib/binding.js:188
throw new Error(‘Failed to locate couchnode native binding’ +
^

Error: Failed to locate couchnode native binding (see above for more information!)
at Object. (/Users/Eric/node_modules/couchbase/lib/binding.js:188:9)
at Module._compile (module.js:434:26)
at Object.Module._extensions…js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/Users/Eric/node_modules/couchbase/lib/couchbase.js:3:15)
at Module._compile (module.js:434:26)
at Object.Module._extensions…js (module.js:452:10)


#2

Evidently Node.js v4.0.0 is a combination of io.js and node.js. I installed a previous version of node.js (v0.12.7) which does not include io.js and now the couchbase SDK is able to be built.


#3

We have support for 4.0.0 ready for the next release, but it didn’t make it into 2.1.0. I would suggest using the latest io.js or Node.js versions rather than Node.js 4.0.0, or you can pull the fix directly from my repository for the moment (https://github.com/brett19/couchnode).

Cheers, Brett


#4

I pulled v0.12.7 of node.js from nodejs.org and it allowed me to build couchbase addon. Appreciate the response. Coding is on.