-
Notifications
You must be signed in to change notification settings - Fork 295
Closed
Description
- Node.js Version: 13.2.0
- OS: Mac
- Scope (install, code, runtime, meta, other?): code
- Module (and version) (if relevant): N-API
Hi guys, I have a problem about the global variable :process.versions.modules
.
In the docs of nodejs, it describe the process.versions.modules
as follow:
process.versions.modules indicates the current ABI version, which is increased whenever a C++ API changes. Node.js will refuse to load modules that were compiled against a different module ABI version.
So with this description, I think if I have a C++ addon with N-API build in the node v8(modules: '57'), and then use it the node v13(modules: '79'), it will throw error. But actually it does not.
And I read the nodejs source code, in the DLOpen
function , I find this if
statements:
// -1 is used for N-API modules
if ((mp->nm_version != -1) && (mp->nm_version != NODE_MODULE_VERSION)) {}
as the comments, if this module is not N-API, so nodejs will compare the module version to current module version, if these two version is not the same, it will report error.
Now I am confusing with this code. versions.modules
is not for N-API ?
Can anyone help me ?
Thanks.
Metadata
Metadata
Assignees
Labels
No labels