Hi,
I am getting version issues I am using nw 0.22.3 and tried lower nw versions but I get above error. Node: 6.10.3, java: jdk 1.8.0 and jre 1.8.0
The module '/home/cronj-10/Sarvani/offline-sample-app-new/node_modules/java/build/Release/nodejavabridge_bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 47. This version of Node.js requires
NODE_MODULE_VERSION 51.
I re-compiled with nw-gyp build --target=nw-version(0.22.3)
My node-java version 0.8.0.
What is issue in building? How to fix this?
I am using ubuntu14.04
could you please provide a sample and steps to reproduce it?
Hi,
I have python 2.7 and java 1.8 on ubuntu 14.04. I installed node java 0.80 with npm install.
After install I did node-gyp build it work fine with node build. As I am building nw js application for above steps I did nw-gyp build and it fails there says make failed -ljvm not found.
After start my application with nw I get below error:
The module '/home/cronj-10/Sarvani/offline-sample-app-new/node_modules/java/build/Release/nodejavabridge_bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 47. This version of Node.js requires
NODE_MODULE_VERSION 51.
Current I am using nw 0.22.3
Is it a version issue? what do I do for this?
It works well on my ubuntu 16.04 with nwjs-sdk-v0.22.3 after I do nw-gyp rebuild --target=0.22.3.
My steps:
test.js:
var java = require('java');
var javaLangSystem = java.import('java.lang.System');
javaLangSystem.out.printlnSync('Hello World');
<script src="test.js"></script>) for nwjsnw-gyp rebuild --target=0.23.2 and node postInstall.js@rogerwang , I find another issue, this doesn't work for nwjs v0.23.2.
Error: /bin/sh: 1: ./build/linux/sysroot_ld_path.sh: not found, is this a nwjs issue or nw-gyp issue?
When I do nw-gyp rebuild --target=0.23.2, some errors occur:
lei@lei-dev:~/00_lei/nwjs/bugs/5960/0.23.2/node_modules/java$ nw-gyp rebuild --target=0.23.2
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/usr/local/lib/node_modules/nw-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/lei/00_lei/nwjs/bugs/5960/0.23.2/node_modules/java/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/lib/node_modules/nw-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/lei/.nw-gyp/0.23.2/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/lei/.nw-gyp/0.23.2',
gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/nw-gyp',
gyp info spawn args '-Dnode_lib_file=nw.lib',
gyp info spawn args '-Dmodule_root_dir=/home/lei/00_lei/nwjs/bugs/5960/0.23.2/node_modules/java',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '-Dv13=1',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
/bin/sh: 1: ./build/linux/sysroot_ld_path.sh: not found
gyp: Call to './build/linux/sysroot_ld_path.sh /home/lei/00_lei/nwjs/bugs/5960/0.23.2/node_modules/java/build/linux/debian_jessie_amd64-sysroot' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/nw-gyp/lib/configure.js:324:16)
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:215:12)
gyp ERR! System Linux 4.4.0-79-generic
gyp ERR! command "/home/lei/tools/node-v6.10.0-linux-x64/bin/node" "/usr/local/bin/nw-gyp" "rebuild" "--target=0.23.2"
gyp ERR! cwd /home/lei/00_lei/nwjs/bugs/5960/0.23.2/node_modules/java
gyp ERR! node -v v6.10.0
gyp ERR! nw-gyp -v v3.4.0
gyp ERR! not ok
I am getting this build issue in ubuntu14.04
../src/utils.cpp:354:33: warning: ‘v8::Local
jdouble val = arg->ToNumber()->Value();
^
SOLINK_MODULE(target) Release/obj.target/nodejavabridge_bindings.node
/usr/bin/ld: cannot find -ljvm
collect2: error: ld returned 1 exit status
make: * [Release/obj.target/nodejavabridge_bindings.node] Error 1
make: Leaving directory /home/cronj-10/Sarvani/offline-sample-app/node_modules/java/build'
gyp ERR! build error
gyp ERR! stack Error:make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/cronj-10/.nvm/versions/node/v5.11.0/lib/node_modules/nw-gyp/lib/build.js:294:23)
gyp ERR! stack at emitTwo (events.js:100:13)
gyp ERR! stack at ChildProcess.emit (events.js:185:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Linux 3.13.0-115-generic
gyp ERR! command "/home/cronj-10/.nvm/versions/node/v5.11.0/bin/node" "/home/cronj-10/.nvm/versions/node/v5.11.0/bin/nw-gyp" "rebuild" "--target=0.22.2"
gyp ERR! cwd /home/cronj-10/Sarvani/offline-sample-app/node_modules/java
gyp ERR! node -v v5.11.0
gyp ERR! nw-gyp -v v3.4.0
gyp ERR! not ok
I am not sure of it from where is the exact issue but node-gyp build works.
@Christywl
Same Error: /bin/sh: 1: ./build/linux/sysroot_ld_path.sh: not found
locate at file ~/.nw-gyp/0.23.2/config.gypi
['OS=="linux" and target_arch=="x64"', {
'sysroot': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_amd64-sysroot',
}],
@swhgoon thanks for your comment.
I have edited file ~/.nw-gyp/0.23.2/common.gypi
removed
['OS=="linux" and target_arch=="x64"', {
'sysroot': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_amd64-sysroot',
}],
and replaced
[ 'target_arch=="x64"', {
'cflags': [ '-m64', '--sysroot=<(sysroot)' ],
'ldflags': [ '-m64', '--sysroot=<(sysroot)','<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))' ],
}],
with
[ 'target_arch=="x64"', {
'cflags': [ '-m64' ],
'ldflags': [ '-m64' ],
}],
and my module succesfuly builded
So, I wrote a 1-liner to handle this issue for now. Just run this pior to npm install:
mkdir -p ~/.nw-gyp/0.23.4 && wget http://node-webkit.s3.amazonaws.com/v0.23.4/nw-headers-v0.23.4.tar.gz && tar -xzvf ./nw-headers-v0.23.4.tar.gz -C ~/.nw-gyp/0.23.4 --strip-components=1 && echo 9 > ~/.nw-gyp/0.23.4/installVersion && patch -u ~/.nw-gyp/0.23.4/common.gypi ./linux-build.patch
The file linux-build.patch does what @Asp3ctus described:
--- common.gypi.old 2017-06-23 20:07:53.288437686 -0300
+++ common.gypi 2017-06-23 20:09:26.616549237 -0300
@@ -52,9 +52,6 @@
['OS=="linux" and target_arch=="ia32"', {
'sysroot': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_i386-sysroot',
}],
- ['OS=="linux" and target_arch=="x64"', {
- 'sysroot': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_amd64-sysroot',
- }],
['OS== "mac"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
#'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
@@ -401,8 +398,8 @@
'ldflags': [ '-mx32' ],
}],
[ 'target_arch=="x64"', {
- 'cflags': [ '-m64', '--sysroot=<(sysroot)' ],
- 'ldflags': [ '-m64', '--sysroot=<(sysroot)','<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))' ],
+ 'cflags': [ '-m64' ],
+ 'ldflags': [ '-m64' ],
}],
[ 'target_arch=="ppc" and OS!="aix"', {
'cflags': [ '-m32' ],
Obviously this assumes you're using v0.23.4, if you want a different version just make the appropriate changes.
@Klemen1337, hello! You wrote https://github.com/mapbox/node-sqlite3/issues/852#issuecomment-323959925:
Fixed with this nwjs/nw.js#5960
Can you write here a link to commit?
hi, all, Is problem fixed?
i can't install this
npm install https://github.com/mapbox/node-sqlite3/tarball/master --build-from-source --runtime=node-webkit --target_arch=x64 --target=0.26.5
This is fixed in git and will be available in 0.26.6.
Most helpful comment
@swhgoon thanks for your comment.
I have edited file ~/.nw-gyp/0.23.2/common.gypi
removed
['OS=="linux" and target_arch=="x64"', { 'sysroot': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_amd64-sysroot', }],and replaced
[ 'target_arch=="x64"', { 'cflags': [ '-m64', '--sysroot=<(sysroot)' ], 'ldflags': [ '-m64', '--sysroot=<(sysroot)','<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))' ], }],with
[ 'target_arch=="x64"', { 'cflags': [ '-m64' ], 'ldflags': [ '-m64' ], }],and my module succesfuly builded