{"action":"created","issue":{"url":"https://api.github.com/repos/joeferner/node-java/issues/250","labels_url":"https://api.github.com/repos/joeferner/node-java/issues/250/labels{/name}","comments_url":"https://api.github.com/repos/joeferner/node-java/issues/250/comments","events_url":"https://api.github.com/repos/joeferner/node-java/issues/250/events","html_url":"https://github.com/joeferner/node-java/issues/250","id":105604694,"number":250,"title":"Install issues with Node v4.0.0 ","user":{"login":"pintux","id":4560610,"avatar_url":"https://avatars.githubusercontent.com/u/4560610?v=3","gravatar_id":"","url":"https://api.github.com/users/pintux","html_url":"https://github.com/pintux","followers_url":"https://api.github.com/users/pintux/followers","following_url":"https://api.github.com/users/pintux/following{/other_user}","gists_url":"https://api.github.com/users/pintux/gists{/gist_id}","starred_url":"https://api.github.com/users/pintux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pintux/subscriptions","organizations_url":"https://api.github.com/users/pintux/orgs","repos_url":"https://api.github.com/users/pintux/repos","events_url":"https://api.github.com/users/pintux/events{/privacy}","received_events_url":"https://api.github.com/users/pintux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-09-09T14:11:10Z","updated_at":"2015-09-13T01:40:35Z","closed_at":null,"body":"Hi,\r\n\r\ntrying to: npm install --save java with Node v.4.0.0\r\nIt fails.\r\n\r\nBelow the npm errors:\r\n\r\n> java@0.5.5 install /mypath/node_modules/java\r\n> node-gyp rebuild\r\n\r\n  CXX(target) Release/obj.target/nodejavabridge_bindings/src/java.o\r\nIn file included from ../src/java.cpp:1:\r\nIn file included from ../src/java.h:9:\r\nIn file included from ../node_modules/nan/nan.h:80:\r\nIn file included from ../node_modules/nan/nan_new.h:190:\r\n../node_modules/nan/nan_implementation_12_inl.h:181:66: error: too many arguments to function call, expected at most 2, have 4\r\n  return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv);\r\n         ~~~~~~~~~~~~~~~~~~                                      ^~~~~~~~~~\r\n/Users/pintux/.node-gyp/4.0.0/include/node/v8.h:4675:3: note: 'New' declared here\r\n  static Local<Signature> New(\r\n  ^\r\nIn file included from ../src/java.cpp:1:\r\nIn file included from ../src/java.h:9:\r\n../node_modules/nan/nan.h:171:25: error: redefinition of '_NanEnsureLocal'\r\nNAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {\r\n                        ^\r\n../node_modules/nan/nan.h:166:25: note: previous definition is here\r\nNAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {\r\n                        ^\r\n../node_modules/nan/nan.h:317:12: error: no matching function for call to '_NanEnsureLocal'\r\n    return NanEscapeScope(NanNew(v8::Undefined(v8::Isolate::GetCurrent())));\r\n           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n../node_modules/nan/nan.h:303:43: note: expanded from macro 'NanEscapeScope'\r\n# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))\r\n                                          ^~~~~~~~~~~~~~~\r\n../node_modules/nan/nan.h:171:25: note: candidate template ignored: substitution failure [with T = v8::Primitive]\r\nNAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {\r\n                        ^\r\n../node_modules/nan/nan.h:322:12: error: no matching function for call to '_NanEnsureLocal'\r\n    return NanEscapeScope(NanNew(v8::Null(v8::Isolate::GetCurrent())));\r\n           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n../node_modules/nan/nan.h:303:43: note: expanded from macro 'NanEscapeScope'\r\n# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))\r\n                                          ^~~~~~~~~~~~~~~\r\n../node_modules/nan/nan.h:171:25: note: candidate template ignored: substitution failure [with T = v8::Primitive]\r\nNAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {\r\n                        ^\r\n../node_modules/nan/nan.h:327:12: error: no matching function for call to '_NanEnsureLocal'\r\n    return NanEscapeScope(NanNew(v8::True(v8::Isolate::GetCurrent())));\r\n           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n../node_modules/nan/nan.h:303:43: note: expanded from macro 'NanEscapeScope'\r\n# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))\r\n                                          ^~~~~~~~~~~~~~~\r\n../node_modules/nan/nan.h:171:25: note: candidate template ignored: substitution failure [with T = v8::Boolean]\r\nNAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {\r\n                        ^\r\n../node_modules/nan/nan.h:332:12: error: no matching function for call to '_NanEnsureLocal'\r\n    return NanEscapeScope(NanNew(v8::False(v8::Isolate::GetCurrent())));\r\n           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n../node_modules/nan/nan.h:303:43: note: expanded from macro 'NanEscapeScope'\r\n# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))\r\n                                          ^~~~~~~~~~~~~~~\r\n../node_modules/nan/nan.h:171:25: note: candidate template ignored: substitution failure [with T = v8::Boolean]\r\nNAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {\r\n                        ^\r\n../node_modules/nan/nan.h:564:13: error: no member named 'smalloc' in namespace 'node'\r\n    , node::smalloc::FreeCallback callback\r\n      ~~~~~~^\r\n../node_modules/nan/nan.h:575:12: error: no matching function for call to 'New'\r\n    return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);\r\n           ^~~~~~~~~~~~~~~~~\r\n/Users/pintux/.node-gyp/4.0.0/include/node/node_buffer.h:31:40: note: candidate function not viable: no known conversion from\r\n      'uint32_t' (aka 'unsigned int') to 'enum encoding' for 3rd argument\r\nNODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,\r\n                                       ^\r\n/Users/pintux/.node-gyp/4.0.0/include/node/node_buffer.h:43:40: note: candidate function not viable: 2nd argument\r\n      ('const char *') would lose const qualifier\r\nNODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,\r\n                                       ^\r\n/Users/pintux/.node-gyp/4.0.0/include/node/node_buffer.h:28:40: note: candidate function not viable: requires 2 arguments, but\r\n      3 were provided\r\nNODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_t length);\r\n                                       ^\r\n/Users/pintux/.node-gyp/4.0.0/include/node/node_buffer.h:36:40: note: candidate function not viable: requires 5 arguments, but\r\n      3 were provided\r\nNODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,\r\n                                       ^\r\nIn file included from ../src/java.cpp:1:\r\nIn file included from ../src/java.h:9:\r\n../node_modules/nan/nan.h:579:12: error: no viable conversion from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object>'\r\n    return node::Buffer::New(v8::Isolate::GetCurrent(), size);\r\n           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n/Users/pintux/.node-gyp/4.0.0/include/node/v8.h:210:7: note: candidate constructor (the implicit copy constructor) not viable:\r\n      no known conversion from 'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object> &' for 1st argument\r\nclass Local {\r\n      ^\r\n/Users/pintux/.node-gyp/4.0.0/include/node/v8.h:210:7: note: candidate constructor (the implicit move constructor) not viable:\r\n      no known conversion from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object> &&' for 1st argument\r\nclass Local {\r\n      ^\r\n/Users/pintux/.node-gyp/4.0.0/include/node/v8.h:214:13: note: candidate template ignored: could not match 'Local' against\r\n      'MaybeLocal'\r\n  V8_INLINE Local(Local<S> that)\r\n            ^\r\n/Users/pintux/.node-gyp/4.0.0/include/node/v8.h:326:13: note: candidate template ignored: could not match 'S *' against\r\n      'v8::MaybeLocal<v8::Object>'\r\n  V8_INLINE Local(S* that)\r\n            ^\r\nIn file included from ../src/java.cpp:1:\r\nIn file included from ../src/java.h:9:\r\n../node_modules/nan/nan.h:586:26: error: no member named 'Use' in namespace 'node::Buffer'\r\n    return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);\r\n           ~~~~~~~~~~~~~~^\r\n../node_modules/nan/nan.h:1403:12: error: no matching function for call to '_NanEnsureLocal'\r\n    return NanEscapeScope(NanNew(handle)->Get(kCallbackIndex)\r\n           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n../node_modules/nan/nan.h:303:43: note: expanded from macro 'NanEscapeScope'\r\n# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))\r\n                                          ^~~~~~~~~~~~~~~\r\n../node_modules/nan/nan.h:171:25: note: candidate template ignored: substitution failure [with T = v8::Function]\r\nNAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {\r\n                        ^\r\n../node_modules/nan/nan.h:1452:12: error: no matching function for call to '_NanEnsureLocal'\r\n    return NanEscapeScope(node::MakeCallback(\r\n           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n../node_modules/nan/nan.h:303:43: note: expanded from macro 'NanEscapeScope'\r\n# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))\r\n                                          ^~~~~~~~~~~~~~~\r\n../node_modules/nan/nan.h:171:25: note: candidate template ignored: substitution failure [with T = v8::Value]\r\nNAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {\r\n                        ^\r\n../node_modules/nan/nan.h:1522:12: error: no matching function for call to '_NanEnsureLocal'\r\n    return NanEscapeScope(handle->Get(NanNew(key)).As<v8::Object>());\r\n           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n../node_modules/nan/nan.h:303:43: note: expanded from macro 'NanEscapeScope'\r\n# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))\r\n                                          ^~~~~~~~~~~~~~~\r\n../node_modules/nan/nan.h:171:25: note: candidate template ignored: substitution failure [with T = v8::Object]\r\nNAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {\r\n                        ^\r\n13 errors generated.\r\nmake: *** [Release/obj.target/nodejavabridge_bindings/src/java.o] Error 1\r\ngyp ERR! build error \r\ngyp ERR! stack Error: `make` failed with exit code: 2\r\ngyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)\r\ngyp ERR! stack     at emitTwo (events.js:87:13)\r\ngyp ERR! stack     at ChildProcess.emit (events.js:172:7)\r\ngyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)\r\ngyp ERR! System Darwin 14.5.0\r\ngyp ERR! command \"/usr/local/bin/node\" \"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"\r\ngyp ERR! cwd /mypath/node_modules/java\r\ngyp ERR! node -v v4.0.0\r\ngyp ERR! node-gyp -v v3.0.1\r\ngyp ERR! not ok \r\nnpm ERR! Darwin 14.5.0\r\nnpm ERR! argv \"/usr/local/bin/node\" \"/usr/local/bin/npm\" \"install\" \"--save\" \"java\"\r\nnpm ERR! node v4.0.0\r\nnpm ERR! npm  v2.14.2\r\nnpm ERR! code ELIFECYCLE\r\n\r\nnpm ERR! java@0.5.5 install: `node-gyp rebuild`\r\nnpm ERR! Exit status 1\r\nnpm ERR! \r\nnpm ERR! Failed at the java@0.5.5 install script 'node-gyp rebuild'.\r\nnpm ERR! This is most likely a problem with the java package,\r\nnpm ERR! not with npm itself.\r\nnpm ERR! Tell the author that this fails on your system:\r\nnpm ERR!     node-gyp rebuild\r\nnpm ERR! You can get their info via:\r\nnpm ERR!     npm owner ls java\r\nnpm ERR! There is likely additional logging output above."},"comment":{"url":"https://api.github.com/repos/joeferner/node-java/issues/comments/139837645","html_url":"https://github.com/joeferner/node-java/issues/250#issuecomment-139837645","issue_url":"https://api.github.com/repos/joeferner/node-java/issues/250","id":139837645,"user":{"login":"jimlloyd","id":18069,"avatar_url":"https://avatars.githubusercontent.com/u/18069?v=3","gravatar_id":"","url":"https://api.github.com/users/jimlloyd","html_url":"https://github.com/jimlloyd","followers_url":"https://api.github.com/users/jimlloyd/followers","following_url":"https://api.github.com/users/jimlloyd/following{/other_user}","gists_url":"https://api.github.com/users/jimlloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/jimlloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimlloyd/subscriptions","organizations_url":"https://api.github.com/users/jimlloyd/orgs","repos_url":"https://api.github.com/users/jimlloyd/repos","events_url":"https://api.github.com/users/jimlloyd/events{/privacy}","received_events_url":"https://api.github.com/users/jimlloyd/received_events","type":"User","site_admin":false},"created_at":"2015-09-13T01:40:35Z","updated_at":"2015-09-13T01:40:35Z","body":"@joeferner great progress. I too have confirmed that `npm install` works with this branch, for both v0.12.7 and v4.0.0 on my Mac. Tests (`npm test`) also pass with v0.12.7 but numerous tests fail with  v4.0.0 (as shown by Travis).\r\n\r\nI diagnosed one class of failures. The function `isWritable(prop)` at line 187 in nodeJavaBridge.js is no longer working as designed. It was designed to deal with special cases for static fields and methods using special property names such as `caller` and `arguments`, but no longer does the right thing for those names. Apparently the behavior of `Object.getOwnPropertyDescriptor()` has changed.\r\n\r\nA workaround is to check for those names explicitly by adding one line:\r\n\r\n```\r\n  if (prop === 'caller' || prop === 'arguments') return false;\r\n```\r\n\r\n\r\n\r\n"}}