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

Build for nw.js v0.12.3 in order to use child_process.fork ? #521

Closed
Tracked by #240
hems opened this issue Oct 2, 2015 · 7 comments
Closed
Tracked by #240

Build for nw.js v0.12.3 in order to use child_process.fork ? #521

hems opened this issue Oct 2, 2015 · 7 comments

Comments

@hems
Copy link

hems commented Oct 2, 2015

Hello Guys,

It seems that nw.js is closing this issue nwjs/nw.js#213 which allows nw.js apps fork child_process which are very useful when doing huge SQLite queries - which still freezing my UI when running on node-webkit 0.8.6.

Any chance we could get it working with v0.12.3 ?

Or Is there any documented workaround in order to perform the query in background without freezing the GUI ?

Thank you!

@TwanoO67
Copy link

HI @hems,

Doc suggest to do:

    npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=x64 --target=0.12.3

But it doesn't seem to work on my installation.
Maybe an outdated version of nw.js and/or sqlite3 would run better?

@hems
Copy link
Author

hems commented Oct 14, 2015

@TwanoO67 i have it working with 0.8.6, and it seems that sqlite supports also 0.10, but this child_process.fork issue seems to be solved on 0.12.

I might be wrong, to be honest this still a bit confusing for me, but it seems that for some reason sqlite3 module would have to "officially support" 0.12 in order for it to work.

@rbfowler9lfc
Copy link

I've been able to build it correctly for nw.js 0.12.3 with the npm command from the docs as @TwanoO67 suggested. Is your installed node version the same as nw.js 0.12.3 is built upon (io.js 1.2.0 IIRC)?
Anyway, prior to upgrading to 0.12.3 I was using 0.9.2 and although cp.fork was still broken, you could use cp.spawn with options.stdio = [null, null, null, 'ipc'] and get the same process.send() functionality as in cp.fork, @hems

@hems
Copy link
Author

hems commented Oct 15, 2015

@rbfowler9lfc thanks a lot for the tip! i'll have a better look at that asap!

thanks!

@hems
Copy link
Author

hems commented Nov 8, 2015

@rbfowler9lfc
Using nvm i switched to iojs-1.2, deleted my node_modules.

did a npm install to get all dependencies, after that i build only sqlite with

npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=x64 --target=0.12.3

It builds OK and all seems fine, but then when opening my app using nw.js version 0.12.3 I still i get this error:

[3819:1108/005039:ERROR:nw_shell.cc(336)] Error: Cannot find module '/Volumes/[...]/app/node_modules/sqlite3/lib/binding/node-webkit-v0.12.3-darwin-ia32/node_sqlite3.node'

@hems
Copy link
Author

hems commented Nov 8, 2015

Actually was my bad, i was using the 32 version of nw.js so i had to tweak the target_arch to "ia32", which is the one my nw.js file was complaining about.

will do some more tests but it seems to be OK

@tmcw
Copy link
Contributor

tmcw commented Jul 19, 2016

nwjs is not yet supported, main ticket is #497

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants