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

node-gyp rebuild error #344

Open
giacgbj opened this issue Aug 2, 2016 · 10 comments
Open

node-gyp rebuild error #344

giacgbj opened this issue Aug 2, 2016 · 10 comments

Comments

@giacgbj
Copy link

giacgbj commented Aug 2, 2016

It could be somehow related to #318 and #343 .

> install-app-deps && typings install

Installing app dependencies for arch x64 to /Users/jhack/path/to/app/app

In file included from ../src/java.cpp:1:
In file included from ../src/java.h:9:
In file included from ../../nan/nan.h:196:
../../nan/nan_maybe_43_inl.h:220:17: warning: 'CloneElementAt' is deprecated [-Wdeprecated-declarations]
  return array->CloneElementAt(GetCurrentContext(), index);
                ^
/Users/jhack/.electron-gyp/.node-gyp/iojs-1.3.1/deps/v8/include/v8.h:3032:36: note: 'CloneElementAt' has been explicitly marked deprecated here
                MaybeLocal<Object> CloneElementAt(Local<Context> context,
                                   ^
In file included from ../src/java.cpp:1:
In file included from ../src/java.h:9:
In file included from ../../nan/nan.h:202:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:40:29: warning: 'New' is deprecated [-Wdeprecated-declarations]
  return v8::BooleanObject::New(value).As<v8::BooleanObject>();
                            ^
/Users/jhack/.electron-gyp/.node-gyp/iojs-1.3.1/deps/v8/include/v8.h:4011:56: note: 'New' has been explicitly marked deprecated here
  V8_DEPRECATED("Pass an isolate", static Local<Value> New(bool value));
                                                       ^
In file included from ../src/java.cpp:1:
In file included from ../src/java.h:9:
../../nan/nan.h:2017:15: warning: 'SetAccessor' is deprecated [-Wdeprecated-declarations]
  return obj->SetAccessor(
              ^
/Users/jhack/.electron-gyp/.node-gyp/iojs-1.3.1/deps/v8/include/v8.h:2742:22: note: 'SetAccessor' has been explicitly marked deprecated here
                bool SetAccessor(Local<Name> name,
                     ^
../src/java.cpp:897:40: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
  v8::Local<v8::Number> val = info[0]->ToNumber();
                                       ^
/Users/jhack/.electron-gyp/.node-gyp/iojs-1.3.1/deps/v8/include/v8.h:8147:22: note: 'ToNumber' has been explicitly marked deprecated here
Local<Number> Value::ToNumber() const {
                     ^
../src/java.cpp:927:40: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
  v8::Local<v8::Number> val = info[0]->ToNumber();
                                       ^
/Users/jhack/.electron-gyp/.node-gyp/iojs-1.3.1/deps/v8/include/v8.h:8147:22: note: 'ToNumber' has been explicitly marked deprecated here
Local<Number> Value::ToNumber() const {
                     ^
../src/java.cpp:956:40: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
  v8::Local<v8::Number> val = info[0]->ToNumber();
                                       ^
/Users/jhack/.electron-gyp/.node-gyp/iojs-1.3.1/deps/v8/include/v8.h:8147:22: note: 'ToNumber' has been explicitly marked deprecated here
Local<Number> Value::ToNumber() const {
                     ^
../src/java.cpp:983:42: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
    v8::Local<v8::Number> val = info[0]->ToNumber();
                                         ^
/Users/jhack/.electron-gyp/.node-gyp/iojs-1.3.1/deps/v8/include/v8.h:8147:22: note: 'ToNumber' has been explicitly marked deprecated here
Local<Number> Value::ToNumber() const {
                     ^
../src/java.cpp:1019:40: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
  v8::Local<v8::Number> val = info[0]->ToNumber();
                                       ^
/Users/jhack/.electron-gyp/.node-gyp/iojs-1.3.1/deps/v8/include/v8.h:8147:22: note: 'ToNumber' has been explicitly marked deprecated here
Local<Number> Value::ToNumber() const {
                     ^
../src/java.cpp:1044:40: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
  v8::Local<v8::Number> val = info[0]->ToNumber();
                                       ^
/Users/jhack/.electron-gyp/.node-gyp/iojs-1.3.1/deps/v8/include/v8.h:8147:22: note: 'ToNumber' has been explicitly marked deprecated here
Local<Number> Value::ToNumber() const {
                     ^
../src/java.cpp:1263:16: warning: 'TryCatch' is deprecated [-Wdeprecated-declarations]
  v8::TryCatch tryCatch;
               ^
/Users/jhack/.electron-gyp/.node-gyp/iojs-1.3.1/deps/v8/include/v8.h:6777:40: note: 'TryCatch' has been explicitly marked deprecated here
  V8_DEPRECATED("Use isolate version", TryCatch());
                                       ^
10 warnings generated.
In file included from ../src/javaObject.cpp:1:
In file included from ../src/javaObject.h:10:
In file included from ../src/methodCallBaton.h:5:
In file included from ../src/utils.h:12:
In file included from ../../nan/nan.h:196:
../../nan/nan_maybe_43_inl.h:220:17: warning: 'CloneElementAt' is deprecated [-Wdeprecated-declarations]
  return array->CloneElementAt(GetCurrentContext(), index);
                ^
/Users/jhack/.electron-gyp/.node-gyp/iojs-1.3.1/deps/v8/include/v8.h:3032:36: note: 'CloneElementAt' has been explicitly marked deprecated here
                MaybeLocal<Object> CloneElementAt(Local<Context> context,
                                   ^
In file included from ../src/javaObject.cpp:1:
In file included from ../src/javaObject.h:10:
In file included from ../src/methodCallBaton.h:5:
In file included from ../src/utils.h:12:
In file included from ../../nan/nan.h:202:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:40:29: warning: 'New' is deprecated [-Wdeprecated-declarations]
  return v8::BooleanObject::New(value).As<v8::BooleanObject>();
                            ^
/Users/jhack/.electron-gyp/.node-gyp/iojs-1.3.1/deps/v8/include/v8.h:4011:56: note: 'New' has been explicitly marked deprecated here
  V8_DEPRECATED("Pass an isolate", static Local<Value> New(bool value));
                                                       ^
In file included from ../src/javaObject.cpp:1:
In file included from ../src/javaObject.h:10:
In file included from ../src/methodCallBaton.h:5:
In file included from ../src/utils.h:12:
../../nan/nan.h:2017:15: warning: 'SetAccessor' is deprecated [-Wdeprecated-declarations]
  return obj->SetAccessor(
              ^
/Users/jhack/.electron-gyp/.node-gyp/iojs-1.3.1/deps/v8/include/v8.h:2742:22: note: 'SetAccessor' has been explicitly marked deprecated here
                bool SetAccessor(Local<Name> name,
                     ^
../src/javaObject.cpp:116:47: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations]
  v8::Local<v8::Object> javaObjectObj = ctor->NewInstance();
                                              ^
/Users/jhack/.electron-gyp/.node-gyp/iojs-1.3.1/deps/v8/include/v8.h:3268:52: note: 'NewInstance' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
                                                   ^
../src/javaObject.cpp:117:18: error: no member named 'SetHiddenValue' in 'v8::Object'
  javaObjectObj->SetHiddenValue(Nan::New<v8::String>(V8_HIDDEN_MARKER_JAVA_OBJECT).ToLocalChecked(), Nan::New<v8::Boolean>(true));
  ~~~~~~~~~~~~~  ^
../src/javaObject.cpp:349:47: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations]
  v8::Local<v8::Object> javaObjectObj = ctor->NewInstance();
                                              ^
/Users/jhack/.electron-gyp/.node-gyp/iojs-1.3.1/deps/v8/include/v8.h:3268:52: note: 'NewInstance' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
                                                   ^
../src/javaObject.cpp:350:18: error: no member named 'SetHiddenValue' in 'v8::Object'
  javaObjectObj->SetHiddenValue(Nan::New<v8::String>(V8_HIDDEN_MARKER_JAVA_OBJECT).ToLocalChecked(), Nan::New<v8::Boolean>(true));
  ~~~~~~~~~~~~~  ^
5 warnings and 2 errors generated.
make: *** [Release/obj.target/nodejavabridge_bindings/src/javaObject.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:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Darwin 15.6.0
gyp ERR! command "/usr/local/Cellar/node/6.3.1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jhack/path/to/app/app/node_modules/java
gyp ERR! node -v v6.3.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/6.3.1/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "install" "--production"
npm ERR! node v6.3.1
npm ERR! npm  v3.10.5
npm ERR! code ELIFECYCLE

npm ERR! java@0.7.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the java@0.7.2 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the java 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 information on how to open an issue for this project with:
npm ERR!     npm bugs java
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls java
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/jhack/path/to/app/app/npm-debug.log
Unhandled rejection Error: /usr/local/Cellar/node/6.3.1/bin/node exited with code 1
    at ChildProcess.childProcess.on.code (/Users/jhack/path/to/app/node_modules/electron-builder/src/util/util.ts:132:14)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:852:16)
    at Socket.<anonymous> (internal/child_process.js:323:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:492:12)
From previous event:
    at spawn (/Users/jhack/path/to/app/node_modules/electron-builder/src/util/util.ts:109:9)
    at spawnNpmProduction (/Users/jhack/path/to/app/node_modules/electron-builder/src/util/util.ts:43:9)
    at Object.installDependencies (/Users/jhack/path/to/app/node_modules/electron-builder/src/util/util.ts:21:120)
    at /Users/jhack/path/to/app/node_modules/electron-builder/src/install-app-deps.ts:30:2
    at next (native)
    at runCallback (timers.js:570:20)
    at tryOnImmediate (timers.js:550:5)
    at processImmediate [as _immediateCallback] (timers.js:529:5)
From previous event:
    at tsAwaiter (/Users/jhack/path/to/app/node_modules/electron-builder/src/util/awaiter.ts:10:47)
    at main (/Users/jhack/path/to/app/node_modules/electron-builder/src/install-app-deps.ts:23:3)
    at Object.<anonymous> (/Users/jhack/path/to/app/node_modules/electron-builder/src/install-app-deps.ts:35:7)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.runMain (module.js:575:10)
    at run (bootstrap_node.js:352:7)
    at startup (bootstrap_node.js:144:9)
    at bootstrap_node.js:467:3
@lamaslam
Copy link

Same here, tried on
java@0.7.2,
node@6.3.0,
npm@3.10.3,
electron-rebuild@1.2.0
electron-prebuild@1.3.3

@Cheonsoon
Copy link

Same for me
java@0.7.2
node@v6.3.1
npm@3.10.3
electron-rebuild@1.2.0
electron-prebuild@1.3.3
https://github.com/electron/electron/releases
maybe because electron core has been Upgrade to Chrome 52? As any electon version over 1.3.0 can not be rebuilt successfully..

@vrmerlin
Copy link

vrmerlin commented Oct 3, 2016

Is there any resolution to this problem? I'm getting the same error. Here's what I do to produce the problem (starting with an empty directory).

npm init
npm install --save electron
npm install --save-dev electron-rebuild
npm install --save java
./node_modules/.bin/electron-rebuild

The last line produces this error:

../src/javaObject.cpp:350:18: error: ‘class v8::Object’ has no member named ‘SetHiddenValue’
   javaObjectObj->SetHiddenValue(Nan::New<v8::String>(V8_HIDDEN_MARKER_JAVA_OBJECT).ToLocalChecked(), Nan::New<v8::Boolean>(true));
                  ^
make: *** [Release/obj.target/nodejavabridge_bindings/src/javaObject.o] Error 1

Here's what I'm using:
Node 6.7.0
NPM 3.10.3
Redhat Linux 7

And here is my package.json after running the above commands:

{
  "name": "java_node_2",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "electron": "^1.4.2",
    "java": "^0.7.2"
  },
  "devDependencies": {
    "electron-rebuild": "^1.2.1"
  }
}

Any ideas on what might be going wrong? It appears that at the moment, Electron and Java don't work together. :-(

John

@PrettyCities
Copy link

Same here. Willing to help provide anyone with additional information if needed

@jadaradix
Copy link

This is due to the node-java dependency on node 7.5 for me. LTS (6.10) gives warnings, but works fine. Look at what NodeGit have done to keep up with v8: https://github.com/nodegit/nodegit/pull/1106/commits

I am going to try and work on a PR for node-java, but it's probably out of my league. Will report back!

@jadaradix
Copy link

jadaradix commented Feb 22, 2017

Update: looks like node-java 0.8 is working on node 7.5! Update version in package.json:

"java": "^0.7.2"

I use npm-check-updates for this. This came up for me as node-java is a dependency of tika. I will make a PR to tika for their package.json dependency of node-java.

@dinvlad
Copy link

dinvlad commented Mar 27, 2017

Same here, 6.10.1 works, 7.7.2 fails with this error

@calbertts
Copy link

Same here trying to compile it in ARM.

@jadaradix
Copy link

Hi @calbertts, @dinvlad - I have no relation to this project but I'm in the thread. On node version 7.9.0 I have got this working with this module version 0.8.0:

  "dependencies": {
    "java": "^0.8.0"
  },

Put that exact version string in your package.json and rm -rf node_modules && npm i to get a full gyp rebuild.

@calbertts how could I reproduce this? Like, get an ARM VM?

@calbertts
Copy link

calbertts commented May 18, 2017

@jadaradix I was using Raspberry PI, at the end I had to downgrade the NodeJS version, I didn't know there was a version that works with Node 7.9.0. Thanks.

It isn't a ARM problem of course, it was about NodeJS.

adekbadek added a commit to adekbadek/atom-sassc-live that referenced this issue Aug 20, 2017
bogas04 added a commit to bogas04/node-opennlp that referenced this issue Sep 21, 2017
bogas04 added a commit to bogas04/node-opennlp that referenced this issue Sep 22, 2017
* Update java dependency to 0.8.0

0.6.0 throws errors on [building](joeferner/node-java#344 (comment))

* Update package.json
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

8 participants