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

Fail to run on ubuntu. #32

Open
dinfer opened this issue Jan 18, 2018 · 3 comments
Open

Fail to run on ubuntu. #32

dinfer opened this issue Jan 18, 2018 · 3 comments

Comments

@dinfer
Copy link

dinfer commented Jan 18, 2018

Follow all steps list on the readme, using ./build.sh to generate. then in the project root, run nw build. the window is shown on the screen, but got an error in the terminal

Using nw.js v0.25.0-sdk
/home/stan/softwares/omgrpc/build/node_modules/grpc/src/grpc_extension.js:47
    throw error;
    ^

Error: Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-webkit-v0.25.0-linux-x64-glibc
Found: [node-v57-linux-x64-glibc]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module '/home/stan/softwares/omgrpc/build/node_modules/grpc/src/node/extension_binary/node-webkit-v0.25.0-linux-x64-glibc/grpc_node.node'
    at Object.<anonymous> (/home/stan/softwares/omgrpc/build/node_modules/grpc/src/grpc_extension.js:45:17)
    at Module._compile (module.js:597:30)
    at Object.Module._extensions..js (module.js:614:10)
    at Module.load (module.js:531:32)
    at tryModuleLoad (module.js:494:12)
    at Function.Module._load (module.js:486:3)
    at Module.require (module.js:541:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/stan/softwares/omgrpc/build/node_modules/grpc/src/client.js:38:12)
    at Module._compile (module.js:597:30)

I run npm rebuild in project root and build dir, nothing changed. What should I do ?

@dinfer
Copy link
Author

dinfer commented Jan 18, 2018

I also try build using command rather than using the build.sh script. got the following error.

> [email protected] install /home/stan/softwares/omgrpc/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

/bin/sh: 1: ./content/nw/tools/sysroot_ld_path.sh: not found
gyp: Call to './content/nw/tools/sysroot_ld_path.sh /home/stan/softwares/omgrpc/node_modules/grpc/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/lib/node_modules/nw-gyp/lib/configure.js:359:16)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.13.0-26-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/nw-gyp" "configure" "--fallback-to-build" "--library=static_library" "--module=/home/stan/softwares/omgrpc/node_modules/grpc/src/node/extension_binary/node-webkit-v0.25.0-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/stan/softwares/omgrpc/node_modules/grpc/src/node/extension_binary/node-webkit-v0.25.0-linux-x64-glibc"
gyp ERR! cwd /home/stan/softwares/omgrpc/node_modules/grpc
gyp ERR! node -v v8.9.3
gyp ERR! nw-gyp -v v3.6.3
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'nw-gyp configure --fallback-to-build --library=static_library --module=/home/stan/softwares/omgrpc/node_modules/grpc/src/node/extension_binary/node-webkit-v0.25.0-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/stan/softwares/omgrpc/node_modules/grpc/src/node/extension_binary/node-webkit-v0.25.0-linux-x64-glibc' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/stan/softwares/omgrpc/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Linux 4.13.0-26-generic
node-pre-gyp ERR! command "/usr/bin/node" "/home/stan/softwares/omgrpc/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /home/stan/softwares/omgrpc/node_modules/grpc
node-pre-gyp ERR! node -v v8.9.3
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute 'nw-gyp configure --fallback-to-build --library=static_library --module=/home/stan/softwares/omgrpc/node_modules/grpc/src/node/extension_binary/node-webkit-v0.25.0-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/stan/softwares/omgrpc/node_modules/grpc/src/node/extension_binary/node-webkit-v0.25.0-linux-x64-glibc' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/stan/.npm/_logs/2018-01-18T07_05_49_949Z-debug.log

@dytomode
Copy link

dytomode commented Feb 1, 2018

I have the same problem

@nickman
Copy link

nickman commented Feb 21, 2018

I was able to fix that using a workaround outlined here: nwjs/nw.js#5960
Specifically (and slightly edited):

Edit file ~/.nw-gyp/0.25.0/common.gypi
remove:
['OS=="linux" and target_arch=="x64"', { 'sysroot': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_amd64-sysroot', }],
replace
[ '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' ], }],

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

3 participants