uhop / node-re2

node.js bindings for RE2: fast, safe alternative to backtracking regular expression engines.
Other
489 stars 53 forks source link

Update to Node 17 #120

Closed bt95 closed 2 years ago

bt95 commented 2 years ago

Hello!

I use re2 library in a project and we want to update to Node v17, which was released in October. When trying to build the project using Node v17 this error shows up: image

Thanks!

uhop commented 2 years ago

At least every major version Node changes ABI. Essentially its internal API changes, which requires recompilation of binary modules. re2 is a binary module based on a C++ library.

As per the error above, it is not sufficient to run a different version of Node in the same application directory, which was initialized by a different Node version. You should run npm i, which, in turn, will recompile necessary modules.

Theoretically, it can happen with pure JS code as well, but usually doesn't because:

So:

uhop commented 2 years ago

I added a precompiled version for Node 17 in 1.17.0, which will be published shortly.

bt95 commented 2 years ago

Thanks a lot for help and for the clear instructions provided.