diff --git a/lib/native.js b/lib/native.js index 68c4e79..051c847 100644 --- a/lib/native.js +++ b/lib/native.js @@ -2,7 +2,7 @@ var events = require('events'); var binary = require('node-pre-gyp'); var path = require('path'); -var binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json'))); +var binding_path = binary.find(path.resolve(path.join(__dirname,'../package.json'))); var binding = require(binding_path); var BluetoothHciSocket = binding.BluetoothHciSocket; diff --git a/package.json b/package.json index 43ee21f..017aae3 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ ], "dependencies": { "debug": "^2.2.0", - "nan": "^2.0.5", + "nan": "^2.10.0", "node-pre-gyp": "0.6.x" }, "optionalDependencies": { diff --git a/src/BluetoothHciSocket.cpp b/src/BluetoothHciSocket.cpp index 469cda2..0cc7427 100644 --- a/src/BluetoothHciSocket.cpp +++ b/src/BluetoothHciSocket.cpp @@ -273,7 +273,7 @@ void BluetoothHciSocket::emitErrnoError() { Nan::New(strerror(errno)).ToLocalChecked() }; - Local error = errorConstructor->NewInstance(1, constructorArgs); + Local error = Nan::NewInstance(errorConstructor, 1, constructorArgs).ToLocalChecked(); Local argv[2] = { Nan::New("error").ToLocalChecked(),