Can't compile native module against electron instead of node.js

你离开我真会死。 提交于 2019-12-24 21:42:44

问题


I am writing a simple native module to use with electron app, but it compiles with the NODE_MODULE_VERSION 72 (node's version) instead of 73 (electron one). I used every possible step described here. electron-rebuild creates a folder structure bin/darwin-x64-73 (where 73 I suppose means module version), but upon requiring it from electron, app threw's with the same error

Here's my simple binding.gyp:

{
    "targets": [
        {
            "target_name":"module_name",
            "sources":["path/to/module.cpp"],
        }
    ]
}

and I guess inside build/config.gypi generated by node-gyp there is line: "node_module_version": 72, which is always the same no matter what method I try

Also, is there a way to tell which NODE_MODULE_VERSION compiled module uses without crashing electron app with wrong one?

来源:https://stackoverflow.com/questions/57942474/cant-compile-native-module-against-electron-instead-of-node-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!