realm-js
realm-js copied to clipboard
Assert NAPI version at runtime
We've seen users experience the following error, when importing our package on outdated versions of Node.js:
undefined symbol: napi_add_finalizer
While we declare our supported engines in our package.json
, users have experienced this when zip'ing up the package and uploading it to AWS Greengrass / Lambdas. We could check the version of NAPI at runtime to verify that we're indeed running on a supported Node.js version, to avoid runtime errors or crashes when loading our native module.
The NAPI version is available via:
process.versions.napi