Currently riak-js fails to install when using node 0.11.14. v0.10.33 is fine. I'm not sure if it's a bug in 0.11 or if it's a bug in wtf8, but it may be prudent to look for a different dependency once v0.12 rolls around.
Not really holding my breath though, y'all are most likely busy getting riak 2.0 stuff done :)
It looks like newer versions of protobuf.js no longer depend on wtf8. I'm going to see if forking your repo & updating the package.json will fix the issue.
Here's the failure stream:
> wtf8@0.1.1 preinstall /home/jon/git/co-riak/node_modules/riak-js/node_modules/protobuf.js/node_modules/wtf8
> node-gyp configure build
child_process: customFds option is deprecated, use stdio instead.
make: Entering directory '/home/jon/git/co-riak/node_modules/riak-js/node_modules/protobuf.js/node_modules/wtf8/build'
CXX(target) Release/obj.target/wtf8/wtf8.o
../wtf8.cc:13:30: error: ‘Arguments’ does not name a type
Handle<Value> Decode(const Arguments& args) {
^
In file included from ../wtf8.cc:1:0:
/home/jon/.node-gyp/0.11.14/deps/v8/include/v8.h: In function ‘v8::Handle<v8::Value> {anonymous}::Decode(const int&)’:
/home/jon/.node-gyp/0.11.14/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
V8_INLINE HandleScope() {}
^
../wtf8.cc:14:17: error: within this context
HandleScope scope;
^
../wtf8.cc:16:36: error: invalid types ‘const int[int]’ for array subscript
if (!Buffer::HasInstance(args[0])) {
^
../wtf8.cc:17:50: error: ‘New’ is not a member of ‘v8::String’
return ThrowException(Exception::TypeError(String::New(
^
../wtf8.cc:18:50: error: ‘ThrowException’ was not declared in this scope
"Argument should be a Buffer object.")));
^
../wtf8.cc:21:40: error: invalid types ‘const int[int]’ for array subscript
const Local<Object> buffer = args[0]->ToObject();
^
../wtf8.cc:28:42: error: no matching function for call to ‘v8::String::Empty()’
Local<String> result = String::Empty();
^
../wtf8.cc:28:42: note: candidate is:
In file included from ../wtf8.cc:1:0:
/home/jon/.node-gyp/0.11.14/deps/v8/include/v8.h:6149:15: note: static v8::Local<v8::String> v8::String::Empty(v8::Isolate*)
Local<String> String::Empty(Isolate* isolate) {
^
/home/jon/.node-gyp/0.11.14/deps/v8/include/v8.h:6149:15: note: candidate expects 1 argument, 0 provided
../wtf8.cc:31:41: error: ‘New’ is not a member of ‘v8::String’
result = String::Concat(result, String::New(data, i));
^
../wtf8.cc:37:41: warning: narrowing conversion of ‘((chr >> 10) | 55296u)’ from ‘uint32_t {aka unsigned int}’ to ‘uint16_t {aka short unsigned int}’ inside { } is ill-formed in C++11 [-Wnarrowing]
uint16_t surrogate[2] = {0xD800 | (chr >> 10), 0xDC00 | (chr & 0x3FF)};
^
../wtf8.cc:37:63: warning: narrowing conversion of ‘((chr & 1023u) | 56320u)’ from ‘uint32_t {aka unsigned int}’ to ‘uint16_t {aka short unsigned int}’ inside { } is ill-formed in C++11 [-Wnarrowing]
uint16_t surrogate[2] = {0xD800 | (chr >> 10), 0xDC00 | (chr & 0x3FF)};
^
../wtf8.cc:40:41: error: ‘New’ is not a member of ‘v8::String’
result = String::Concat(result, String::New(surrogate, 2));
^
../wtf8.cc:50:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
return scope.Close(String::Concat(result, String::New(data + split, length - split)));
^
../wtf8.cc:50:47: error: ‘New’ is not a member of ‘v8::String’
return scope.Close(String::Concat(result, String::New(data + split, length - split)));
^
../wtf8.cc: At global scope:
../wtf8.cc:59:30: error: ‘Arguments’ does not name a type
Handle<Value> Encode(const Arguments& args) {
^
In file included from ../wtf8.cc:1:0:
/home/jon/.node-gyp/0.11.14/deps/v8/include/v8.h: In function ‘v8::Handle<v8::Value> {anonymous}::Encode(const int&)’:
/home/jon/.node-gyp/0.11.14/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
V8_INLINE HandleScope() {}
^
../wtf8.cc:60:17: error: within this context
HandleScope scope;
^
../wtf8.cc:62:16: error: invalid types ‘const int[int]’ for array subscript
if (!args[0]->IsString()) {
^
../wtf8.cc:63:50: error: ‘New’ is not a member of ‘v8::String’
return ThrowException(Exception::TypeError(String::New(
^
../wtf8.cc:64:43: error: ‘ThrowException’ was not declared in this scope
"Argument should be a String.")));
^
../wtf8.cc:67:34: error: invalid types ‘const int[int]’ for array subscript
Local<String> string = args[0]->ToString();
^
../wtf8.cc:105:11: error: expected primary-expression before ‘&’ token
Buffer& slowBuffer = *Buffer::New(accumulator.size());
^
../wtf8.cc:105:13: error: ‘slowBuffer’ was not declared in this scope
Buffer& slowBuffer = *Buffer::New(accumulator.size());
^
../wtf8.cc:109:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
return scope.Close(slowBuffer.handle_);
^
../wtf8.cc: In function ‘void {anonymous}::RegisterModule(v8::Handle<v8::Object>)’:
../wtf8.cc:113:17: error: ‘NewSymbol’ is not a member of ‘v8::String’
target->Set(String::NewSymbol("decode"), FunctionTemplate::New(Decode)->GetFunction());
^
../wtf8.cc:113:74: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’
target->Set(String::NewSymbol("decode"), FunctionTemplate::New(Decode)->GetFunction());
^
../wtf8.cc:113:74: note: candidate is:
In file included from ../wtf8.cc:1:0:
/home/jon/.node-gyp/0.11.14/deps/v8/include/v8.h:3434:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int)
static Local<FunctionTemplate> New(
^
/home/jon/.node-gyp/0.11.14/deps/v8/include/v8.h:3434:34: note: no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’
../wtf8.cc:114:17: error: ‘NewSymbol’ is not a member of ‘v8::String’
target->Set(String::NewSymbol("encode"), FunctionTemplate::New(Encode)->GetFunction());
^
../wtf8.cc:114:74: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’
target->Set(String::NewSymbol("encode"), FunctionTemplate::New(Encode)->GetFunction());
^
../wtf8.cc:114:74: note: candidate is:
In file included from ../wtf8.cc:1:0:
/home/jon/.node-gyp/0.11.14/deps/v8/include/v8.h:3434:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int)
static Local<FunctionTemplate> New(
^
/home/jon/.node-gyp/0.11.14/deps/v8/include/v8.h:3434:34: note: no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’
wtf8.target.mk:84: recipe for target 'Release/obj.target/wtf8/wtf8.o' failed
make: *** [Release/obj.target/wtf8/wtf8.o] Error 1
make: Leaving directory '/home/jon/git/co-riak/node_modules/riak-js/node_modules/protobuf.js/node_modules/wtf8/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/jon/.nvm/v0.11.14/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1059:12)
gyp ERR! System Linux 3.16.0-23-generic
gyp ERR! command "node" "/home/jon/.nvm/v0.11.14/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /home/jon/git/co-riak/node_modules/riak-js/node_modules/protobuf.js/node_modules/wtf8
gyp ERR! node -v v0.11.14
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Linux 3.16.0-23-generic
npm ERR! argv "/home/jon/.nvm/v0.11.14/bin/node" "/home/jon/.nvm/v0.11.14/bin/npm" "install" "riak-js"
npm ERR! node v0.11.14
npm ERR! npm v2.0.0
npm ERR! code ELIFECYCLE
npm ERR! wtf8@0.1.1 preinstall: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the wtf8@0.1.1 preinstall script.
npm ERR! This is most likely a problem with the wtf8 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls wtf8
npm ERR! There is likely additional logging output above.
Currently riak-js fails to install when using node 0.11.14. v0.10.33 is fine. I'm not sure if it's a bug in 0.11 or if it's a bug in wtf8, but it may be prudent to look for a different dependency once v0.12 rolls around.
Not really holding my breath though, y'all are most likely busy getting riak 2.0 stuff done :)
This has already been reported on the wtf8 repository (https://github.com/lautis/wtf8/issues/1), but it looks like that project is dead.
It looks like newer versions of protobuf.js no longer depend on wtf8. I'm going to see if forking your repo & updating the package.json will fix the issue.
Here's the failure stream: