better-sqlite3 icon indicating copy to clipboard operation
better-sqlite3 copied to clipboard

How to build for nw.js 0.54.0?

Open ching2018 opened this issue 4 years ago • 3 comments

Hello, how to build for nw.js 0.54.0?

ching2018 avatar Jun 18 '21 15:06 ching2018

While it should be possible to also use prebuild for building native module for nw.js, this does not look so smooth like building for node or electron.

Took several attempts to build for the latest release 0.77.0, but it's pretty tricky. First hirdle is, that nw-gyp, which will be used for the actual build, still relies on Python 2. After solving this issue I am now stuck getting it to work with my msvc setup - tried 2015, 2017, 2019 and 2022 and it wouldn't take any of them :-/.

Anyone got more experience in building for nw.js? Otherwise I would tend to say: use electron :x

neoxpert avatar Jul 21 '23 19:07 neoxpert

It's work for me

cd node_modules/better-sqlite3
npx nw-gyp rebuild --release --build-from-source --runtime=nwjs --target=0.80.0

You can change 0.80.0 to the version you want

TinsFox avatar Nov 15 '23 08:11 TinsFox

hey @neoxpert

I personally recommend you to use electron. The construction of nwjs needs to handle prod dependencies by itself. nw-builder will not automatically copy required dependencies. There doesn't seem to be this problem in electron. I'm not sure, I didn't go into a complete comparison

TinsFox avatar Nov 15 '23 08:11 TinsFox