connor4312 / blake3

BLAKE3 hashing for JavaScript: native Node bindings (where available) and WebAssembly
https://connor4312.github.io/blake3/index.html
MIT License
177 stars 18 forks source link

Node 14 is not supported #17

Closed telamon closed 4 years ago

telamon commented 4 years ago

I hope that I'm barking up the right tree :)

$ node --version
v14.2.0
$ npm install

> blake3@2.1.3 install /.../node_modules/blake3
> node -e "try{require('./dist/build/install')}catch(e){}"

API version for node linux not explicitly built, falling back to latest. If this does not work, open an issue at https://github.com/connor4312/blake3/issues/new
Retrieving native BLAKE3 bindings for Node v14 on linux...
BLAKE3 bindings retrieved

And when i run my tests that require('blake3')

$ node test.js
internal/modules/cjs/loader.js:1226
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: /.../node_modules/blake3/dist/native.node: undefined symbol: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeE
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1226:18)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)
    at Module.require (internal/modules/cjs/loader.js:1080:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/.../node_modules/blake3/dist/node-native/native.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:1176:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)

Is there a way to force building the node bindings?

connor4312 commented 4 years ago

Thanks for the issue, published prebuilt bindings for Node 14 in the latest 2.1.4. Also added a step in postinstall to validate the bindings before installing them, so we'll fall back to webassembly rather than failing if bindings aren't available.

telamon commented 4 years ago

Thank you for the fix, much appreciated! :+1:

sekarpdkt commented 4 years ago

Do you have prebuilt binary for arm64?

CumpsD commented 2 years ago

Getting Module did not self-register with 2.1.7