问题
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