Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency issue - nan #49

Closed
bezreyhan opened this issue Jul 31, 2015 · 1 comment
Closed

Dependency issue - nan #49

bezreyhan opened this issue Jul 31, 2015 · 1 comment

Comments

@bezreyhan
Copy link

It seems that the latest version of nan is causing issues. Neither myself not my coworkers were able install sodium. Though, if we change the nan dependency to "nan": "^1.6.2" then it loads up fine.
Here are the errors:

../sodium.cc:26:27: error: use of undeclared identifier 'NanGetCurrentContext'; did you mean 'Nan::GetCurrentContext'?
Local globalObj = NanGetCurrentContext()->Global();
^~~~~~~~~~~~~~~~~~~~
Nan::GetCurrentContext
../node_modules/nan/nan.h:939:37: note: 'Nan::GetCurrentContext' declared here
NAN_INLINE v8::Localv8::Context GetCurrentContext() {
^
../sodium.cc:30:45: error: use of undeclared identifier 'NanNew'
Local::Cast(globalObj->Get(NanNew("Buffer")));
^
../sodium.cc:30:52: error: 'String' does not refer to a value
Local::Cast(globalObj->Get(NanNew("Buffer")));
^
/Users/bezreyhan/.node-gyp/0.10.29/deps/v8/include/v8.h:1024:7: note: declared here
class String : public Primitive {
^
../sodium.cc:91:5: error: use of undeclared identifier 'NanEscapableScope'
NanEscapableScope();
^
../sodium.cc:92:20: error: use of undeclared identifier 'NanNew'
NanReturnValue(NanNew(sodium_version_string()));
^
../sodium.cc:92:27: error: 'String' does not refer to a value
NanReturnValue(NanNew(sodium_version_string()));
^
/Users/bezreyhan/.node-gyp/0.10.29/deps/v8/include/v8.h:1024:7: note: declared here
class String : public Primitive {
^
../sodium.cc:96:5: error: use of undeclared identifier 'NanEscapableScope'
NanEscapableScope();
^
../sodium.cc:98:9: error: use of undeclared identifier 'NanNew'
NanNew(sodium_library_version_minor())
^
../sodium.cc:103:5: error: use of undeclared identifier 'NanEscapableScope'
NanEscapableScope();
^
../sodium.cc:105:9: error: use of undeclared identifier 'NanNew'
NanNew(sodium_library_version_major())
^
../sodium.cc:111:5: error: use of undeclared identifier 'NanEscapableScope'
NanEscapableScope();
^
../sodium.cc:113:5: error: use of undeclared identifier 'args'; did you mean 'uv_process_options_s::args'?
NUMBER_OF_MANDATORY_ARGS(1,"argument must be a buffer");
^
../sodium.cc:78:9: note: expanded from macro 'NUMBER_OF_MANDATORY_ARGS'
if (args.Length() < (n)) {
^
/Users/bezreyhan/.node-gyp/0.10.29/deps/uv/include/uv.h:1326:10: note: 'uv_process_options_s::args' declared here
char** args;
^
../sodium.cc:113:5: error: invalid use of non-static data member 'args'
NUMBER_OF_MANDATORY_ARGS(1,"argument must be a buffer");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../sodium.cc:78:9: note: expanded from macro 'NUMBER_OF_MANDATORY_ARGS'
if (args.Length() < (n)) {
^~~~
../sodium.cc:113:5: error: use of undeclared identifier 'NanThrowError'; did you mean 'Nan::ThrowError'?
../sodium.cc:79:16: note: expanded from macro 'NUMBER_OF_MANDATORY_ARGS'
return NanThrowError(message);
^
../node_modules/nan/nan.h:1003:3: note: 'Nan::ThrowError' declared here
X(Error)
^
../node_modules/nan/nan.h:993:21: note: expanded from macro 'X'
NAN_INLINE void Throw ## NAME(const char msg) {
^
:76:1: note: expanded from here
ThrowError
^
../sodium.cc:114:5: error: use of undeclared identifier 'args'; did you mean 'uv_process_options_s::args'?
GET_ARG_AS_VOID(0, buffer);
^
../sodium.cc:71:5: note: expanded from macro 'GET_ARG_AS_VOID'
GET_ARG_AS(i, NAME, void
)
^
../sodium.cc:47:5: note: expanded from macro 'GET_ARG_AS'
ARG_IS_BUFFER(i,#NAME);
^
../sodium.cc:35:30: note: expanded from macro 'ARG_IS_BUFFER'
if (!Buffer::HasInstance(args[i])) {
^
/Users/bezreyhan/.node-gyp/0.10.29/deps/uv/include/uv.h:1326:10: note: 'uv_process_options_s::args' declared here
char** args;
^
../sodium.cc:114:5: error: invalid use of non-static data member 'args'
GET_ARG_AS_VOID(0, buffer);
^~~~~~~~~~~~~~~~~~~~~~~~~~
../sodium.cc:71:5: note: expanded from macro 'GET_ARG_AS_VOID'
GET_ARG_AS(i, NAME, void_)
^~~~~~~~~~~~~~~~~~~~~~~~~~
../sodium.cc:47:5: note: expanded from macro 'GET_ARG_AS'
ARG_IS_BUFFER(i,#NAME);
^~~~~~~~~~~~~~~~~~~~~~
../sodium.cc:35:30: note: expanded from macro 'ARG_IS_BUFFER'
if (!Buffer::HasInstance(args[i])) {
^~~~
../sodium.cc:114:5: error: use of undeclared identifier 'NanThrowError'; did you mean 'Nan::ThrowError'?
../sodium.cc:71:5: note: expanded from macro 'GET_ARG_AS_VOID'
GET_ARG_AS(i, NAME, void_)
^
../sodium.cc:47:5: note: expanded from macro 'GET_ARG_AS'
ARG_IS_BUFFER(i,#NAME);
^
../sodium.cc:38:16: note: expanded from macro 'ARG_IS_BUFFER'
return NanThrowError(oss.str().c_str());
^
../node_modules/nan/nan.h:1003:3: note: 'Nan::ThrowError' declared here
X(Error)
^
../node_modules/nan/nan.h:993:21: note: expanded from macro 'X'
NAN_INLINE void Throw ## NAME(const char msg) {
^
:76:1: note: expanded from here
ThrowError
^
../sodium.cc:114:5: error: use of undeclared identifier 'args'; did you mean 'uv_process_options_s::args'?
GET_ARG_AS_VOID(0, buffer);
^
../sodium.cc:71:5: note: expanded from macro 'GET_ARG_AS_VOID'
GET_ARG_AS(i, NAME, void
)
^
../sodium.cc:48:37: note: expanded from macro 'GET_ARG_AS'
TYPE NAME = (TYPE) Buffer::Data(args[i]->ToObject());
^
/Users/bezreyhan/.node-gyp/0.10.29/deps/uv/include/uv.h:1326:10: note: 'uv_process_options_s::args' declared here
char** args;
^
../sodium.cc:114:5: error: invalid use of non-static data member 'args'
GET_ARG_AS_VOID(0, buffer);
^~~~~~~~~~~~~~~~~~~~~~~~~~
../sodium.cc:71:5: note: expanded from macro 'GET_ARG_AS_VOID'
GET_ARG_AS(i, NAME, void_)
^~~~~~~~~~~~~~~~~~~~~~~~~~
../sodium.cc:48:37: note: expanded from macro 'GET_ARG_AS'
TYPE NAME = (TYPE) Buffer::Data(args[i]->ToObject());
^~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *_* [Release/obj.target/sodium/sodium.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:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Darwin 14.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/bezreyhan/code/gem.co/node-sodium
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok

npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.29
npm ERR! npm v2.10.0
npm ERR! code ELIFECYCLE
npm ERR! sodium@1.0.19 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sodium@1.0.19 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the sodium 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 sodium
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/bezreyhan/code/gem.co/node-sodium/npm-debug.log

@squirrelsama
Copy link

@bezreyhan This is also a problem for me. Thanks for the workaround! I can confirm this builds with nan@1.9.0.

@paixaop paixaop closed this as completed in 44fd2d9 Aug 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants