0

Today I discovered that old versions of node-fibers and bcrypt that compile successfully on node 0.10.40 don't compile successfully on node 5.1.0.

For instance if I try to compile bcrypt 0.7.8, I get errors that must surely be due to changes in the V8 API:

> bcrypt@0.7.8 install /Users/andy/jcore-portal/target/device/dist/bundle/node_modules/bcrypt
> node-gyp rebuild

  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
../src/bcrypt_node.cc:54:18: error: no member named 'Dispose' in
      'v8::Persistent<v8::Function, v8::NonCopyablePersistentTraits<v8::Function>
      >'
        callback.Dispose();
        ~~~~~~~~ ^
../src/bcrypt_node.cc:128:19: error: unknown type name 'uv_work_t'
void GenSaltAsync(uv_work_t* req) {

...

Clearly bcrypt was not able to determine that the V8 API was an incompatible version. Nor do I see any fields in package.json or node-gyp config that would seem applicable. Is this a bug in its build script, or is it merely impossible for packages to determine the V8 library version?

ZachB
  • 13,051
  • 4
  • 61
  • 89
Andy
  • 7,885
  • 5
  • 55
  • 61
  • It looks like `bcrypt` has their `nan` dependency version fixed instead of using the caret so that newer (backwards compatible) versions get picked up automatically. You should consider filing an issue on their GH issue tracker and/or submitting a PR to add the caret. – mscdex Dec 05 '15 at 02:28

1 Answers1

0

https://docs.npmjs.com/files/package.json#engines

You can specify the version of node that your stuff works on:

{
... 
  "engines" : { 
    "node" : ">=0.10.3 <0.12" 
  }
}
sarkiroka
  • 1,485
  • 20
  • 28