Thursday, 28 March 2019

How to build native nodejs modules for launchui?

I'm building an app using proton-native. it uses native modules written in C++, for example, keytar.

Proton-native uses a tool named launchui to package nodejs app as an executable. It's basically simple wrapper for nodejs with the following structure on windows:

- myapp.exe
- node.dll
- app/
- - main.js
- - node_modules/
- - - - keytar/

Native modules (node addons) does not work by default for such constructions because node-gyp tool links them against node.exe. The usual approach is to run something like electron-rebuild, which would compile native modules to a version of node incorporated by electronjs.

However, In case of launchui there are no tools for that yet.

Could someone skilled in node-gyp or C++ linking explain what whould be the best approach to properly re-build native modules for launchui? I keep getting The specified procedure could not be found after running electron-rebuild and trying to run the app.

I have used dependencywalker to analyze current dependencies of the keytar.node and it shows that it depends on node.exe, however it should depend on node.dll.



from How to build native nodejs modules for launchui?

No comments:

Post a Comment