Skip to content

Instantly share code, notes, and snippets.

@BryanDonovan
Created September 21, 2015 18:02
Show Gist options
  • Save BryanDonovan/3a9a4dd627a056bac99a to your computer and use it in GitHub Desktop.
Save BryanDonovan/3a9a4dd627a056bac99a to your computer and use it in GitHub Desktop.
node-protobuf install issue with latest NaN module
$ npm i
> node-protobuf@1.2.7 install /Users/bdonovan/code/node/node-protobuf
> node-gyp rebuild
CXX(target) Release/obj.target/protobuf/src/init.o
CXX(target) Release/obj.target/protobuf/src/native.o
../src/native.cpp:11:32: error: use of undeclared identifier 'NanNew'
Local<FunctionTemplate> tpl = NanNew<FunctionTemplate>(New);
^
../src/native.cpp:11:39: error: 'FunctionTemplate' does not refer to a value
Local<FunctionTemplate> tpl = NanNew<FunctionTemplate>(New);
^
/Users/bdonovan/.node-gyp/4.1.0/include/node/v8.h:4346:17: note: declared here
class V8_EXPORT FunctionTemplate : public Template {
^
../src/native.cpp:13:20: error: use of undeclared identifier 'NanNew'
tpl->SetClassName(NanNew<String>("NativeProtobuf"));
^
../src/native.cpp:13:27: error: 'String' does not refer to a value
tpl->SetClassName(NanNew<String>("NativeProtobuf"));
^
/Users/bdonovan/.node-gyp/4.1.0/include/node/v8.h:2081:17: note: declared here
class V8_EXPORT String : public Name {
^
../src/native.cpp:17:42: error: cannot initialize a parameter of type 'v8::FunctionCallback' (aka 'void (*)(const FunctionCallbackInfo<v8::Value> &)') with
an lvalue of type 'Nan::NAN_METHOD_RETURN_TYPE (Nan::NAN_METHOD_ARGS_TYPE)': type mismatch at 1st parameter ('const FunctionCallbackInfo<v8::Value> &'
(aka 'const v8::FunctionCallbackInfo<v8::Value> &') vs 'Nan::NAN_METHOD_ARGS_TYPE' (aka 'const FunctionCallbackInfo<v8::Value> &'))
NODE_SET_PROTOTYPE_METHOD(tpl, "parse", NativeProtobuf::Parse);
^~~~~~~~~~~~~~~~~~~~~
/Users/bdonovan/.node-gyp/4.1.0/include/node/node.h:254:60: note: passing argument to parameter 'callback' here
v8::FunctionCallback callback) {
^
../src/native.cpp:18:46: error: cannot initialize a parameter of type 'v8::FunctionCallback' (aka 'void (*)(const FunctionCallbackInfo<v8::Value> &)') with
an lvalue of type 'Nan::NAN_METHOD_RETURN_TYPE (Nan::NAN_METHOD_ARGS_TYPE)': type mismatch at 1st parameter ('const FunctionCallbackInfo<v8::Value> &'
(aka 'const v8::FunctionCallbackInfo<v8::Value> &') vs 'Nan::NAN_METHOD_ARGS_TYPE' (aka 'const FunctionCallbackInfo<v8::Value> &'))
NODE_SET_PROTOTYPE_METHOD(tpl, "serialize", NativeProtobuf::Serialize);
^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bdonovan/.node-gyp/4.1.0/include/node/node.h:254:60: note: passing argument to parameter 'callback' here
v8::FunctionCallback callback) {
^
../src/native.cpp:19:41: error: cannot initialize a parameter of type 'v8::FunctionCallback' (aka 'void (*)(const FunctionCallbackInfo<v8::Value> &)') with
an lvalue of type 'Nan::NAN_METHOD_RETURN_TYPE (Nan::NAN_METHOD_ARGS_TYPE)': type mismatch at 1st parameter ('const FunctionCallbackInfo<v8::Value> &'
(aka 'const v8::FunctionCallbackInfo<v8::Value> &') vs 'Nan::NAN_METHOD_ARGS_TYPE' (aka 'const FunctionCallbackInfo<v8::Value> &'))
NODE_SET_PROTOTYPE_METHOD(tpl, "info", NativeProtobuf::Info);
^~~~~~~~~~~~~~~~~~~~
/Users/bdonovan/.node-gyp/4.1.0/include/node/node.h:254:60: note: passing argument to parameter 'callback' here
v8::FunctionCallback callback) {
^
../src/native.cpp:21:2: error: use of undeclared identifier 'NanAssignPersistent'
NanAssignPersistent(constructor, tpl->GetFunction());
^
../src/native.cpp:22:15: error: use of undeclared identifier 'NanNew'
exports->Set(NanNew<String>("native"), tpl->GetFunction());
^
../src/native.cpp:22:22: error: 'String' does not refer to a value
exports->Set(NanNew<String>("native"), tpl->GetFunction());
^
/Users/bdonovan/.node-gyp/4.1.0/include/node/v8.h:2081:17: note: declared here
class V8_EXPORT String : public Name {
^
../src/native.cpp:26:2: error: use of undeclared identifier 'NanScope'
NanScope();
^
../src/native.cpp:28:29: error: use of undeclared identifier 'args'; did you mean 'uv_process_options_s::args'?
Local<Object> buffer_obj = args[0]->ToObject();
^~~~
uv_process_options_s::args
/Users/bdonovan/.node-gyp/4.1.0/include/node/uv.h:862:10: note: 'uv_process_options_s::args' declared here
char** args;
^
../src/native.cpp:28:29: error: invalid use of member 'args' in static member function
Local<Object> buffer_obj = args[0]->ToObject();
^~~~
../src/native.cpp:34:10: error: use of undeclared identifier 'NanThrowError'; did you mean 'Nan::ThrowError'?
return NanThrowError("Malformed descriptor");
^~~~~~~~~~~~~
Nan::ThrowError
../node_modules/nan/nan.h:639:3: note: 'Nan::ThrowError' declared here
X(Error)
^
../node_modules/nan/nan.h:627:21: note: expanded from macro 'X'
NAN_INLINE void Throw ## NAME(const char *msg) { \
^
<scratch space>:325:1: note: expanded from here
ThrowError
^
../src/native.cpp:36:27: error: redefinition of 'info' with a different type: 'std::vector<std::string>' vs 'Nan::NAN_METHOD_ARGS_TYPE'
(aka 'const FunctionCallbackInfo<v8::Value> &')
std::vector<std::string> info;
^
../src/native.cpp:25:1: note: previous definition is here
NAN_METHOD(NativeProtobuf::New) {
^
../node_modules/nan/nan.h:1266:64: note: expanded from macro 'NAN_METHOD'
Nan::NAN_METHOD_RETURN_TYPE name(Nan::NAN_METHOD_ARGS_TYPE info)
^
../src/native.cpp:44:9: error: no member named 'push_back' in 'Nan::FunctionCallbackInfo<v8::Value>'
info.push_back(name);
~~~~ ^
../src/native.cpp:48:30: error: no matching constructor for initialization of 'NativeProtobuf'
NativeProtobuf *proto = new NativeProtobuf(pool, info);
^ ~~~~~~~~~~
../src/native.cpp:7:17: note: candidate constructor not viable: no known conversion from 'const FunctionCallbackInfo<v8::Value>' to
'std::vector<std::string>' for 2nd argument
NativeProtobuf::NativeProtobuf(DescriptorPool *pool, std::vector<std::string> info): pool(pool), info(info) {}
^
../src/native.h:6:7: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided
class NativeProtobuf : public node::ObjectWrap {
^
../src/native.h:6:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
../src/native.cpp:49:14: error: use of undeclared identifier 'args'; did you mean 'uv_process_options_s::args'?
proto->Wrap(args.This());
^~~~
uv_process_options_s::args
/Users/bdonovan/.node-gyp/4.1.0/include/node/uv.h:862:10: note: 'uv_process_options_s::args' declared here
char** args;
^
../src/native.cpp:49:14: error: invalid use of member 'args' in static member function
proto->Wrap(args.This());
^~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/protobuf/src/native.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/bdonovan/.nvm/versions/node/v4.1.0/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 "/Users/bdonovan/.nvm/versions/node/v4.1.0/bin/node" "/Users/bdonovan/.nvm/versions/node/v4.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/bdonovan/code/node/node-protobuf
gyp ERR! node -v v4.1.0
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok
npm WARN EPACKAGEJSON node-protobuf@1.2.7 No license field.
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/bdonovan/.nvm/versions/node/v4.1.0/bin/node" "/Users/bdonovan/.nvm/versions/node/v4.1.0/bin/npm" "i"
npm ERR! node v4.1.0
npm ERR! npm v3.3.3
npm ERR! code ELIFECYCLE
npm ERR! node-protobuf@1.2.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-protobuf@1.2.7 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-protobuf package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-protobuf
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/bdonovan/code/node/node-protobuf/npm-debug.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment