Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install on node 10 #84

Open
kounch opened this issue May 6, 2018 · 40 comments
Open

Cannot install on node 10 #84

kounch opened this issue May 6, 2018 · 40 comments

Comments

@kounch
Copy link

kounch commented May 6, 2018

(...) In file included from ../src/BluetoothHciSocket.cpp:8:0: ../../nan/nan.h:950:46: nota: se declara aquí NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback( ^~~~~~~~~~~~ ../src/BluetoothHciSocket.cpp: En la función miembro void BluetoothHciSocket::emitErrnoError(): ../src/BluetoothHciSocket.cpp:275:72: error: no matching function for call to v8::Function::NewInstance(int, v8::Local<v8::Value> [1]) Local<Value> error = errorConstructor->NewInstance(1, constructorArgs); (...)

Possibly related to old nan dependency, like is mentioned here:

agnat/node_mdns#210

@mogenson
Copy link

mogenson commented May 7, 2018

On Linux x86_64 with nodejs 10.0.0-1

In file included from ../src/BluetoothHciSocket.cpp:8:0:
../../nan/nan.h:950:46: note: declared here
   NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
                                              ^~~~~~~~~~~~
make: *** [binding.target.mk:95: Release/obj.target/binding/src/BluetoothHciSocket.o] Error 1
make: Leaving directory '/path/to/my/node/project/node_modules/bluetooth-hci-socket/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
gyp ERR! System Linux 4.16.7-1-MANJARO
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/mike/Scansorial/root-bootloader/xsquare/node_modules/bluetooth-hci-socket
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

@kounch
Copy link
Author

kounch commented May 25, 2018

After some tests, it looks like making these two changes solve the problem:

File src/BluetoothHciSocket.cpp, change line 276 from
Local<Value> error = errorConstructor->NewInstance(1, constructorArgs);
to
Local<Value> error = Nan::NewInstance(errorConstructor, 1, constructorArgs).ToLocalChecked();

File package.json, change line 30 from
"nan": "^2.0.5",
to
"nan": "^2.10.0",

@airhorns
Copy link

airhorns commented Jun 1, 2018

I'm also getting this error and can confirm downgrading to node 8.11.1 fixed my issue. My full build log:

[main]  info This module is OPTIONAL, you can safely ignore this error
[main]  warning Error running install script for optional dependency: "/node_modules/bluetooth-hci-socket: Command failed.
[main]  Exit code: 1
[main]  Command: node-gyp rebuild
[main]  Arguments:
[main]  Directory: /node_modules/bluetooth-hci-socket
[main]  Output:
[main]  gyp info it worked if it ends with ok
[main]  gyp info using node-gyp@3.6.2
[main]  gyp info using node@10.0.0 | linux | arm
[main]  gyp info spawn /usr/bin/python2
[main]  gyp info spawn args [ '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
[main]  gyp info spawn args   'binding.gyp',
[main]  gyp info spawn args   '-f',
[main]  gyp info spawn args   'make',
[main]  gyp info spawn args   '-I',
[main]  gyp info spawn args   '/node_modules/bluetooth-hci-socket/build/config.gypi',
[main]  gyp info spawn args   '-I',
[main]  gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
[main]  gyp info spawn args   '-I',
[main]  gyp info spawn args   '/root/.node-gyp/10.0.0/include/node/common.gypi',
[main]  gyp info spawn args   '-Dlibrary=shared_library',
[main]  gyp info spawn args   '-Dvisibility=default',
[main]  gyp info spawn args   '-Dnode_root_dir=/root/.node-gyp/10.0.0',
[main]  gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
[main]  gyp info spawn args   '-Dnode_lib_file=/root/.node-gyp/10.0.0/<(target_arch)/node.lib',
[main]  gyp info spawn args   '-Dmodule_root_dir=/node_modules/bluetooth-hci-socket',
[main]  gyp info spawn args   '-Dnode_engine=v8',
[main]  gyp info spawn args   '--depth=.',
[main]  gyp info spawn args   '--no-parallel',
[main]  gyp info spawn args   '--generator-output',
[main]  gyp info spawn args   'build',
[main]  gyp info spawn args   '-Goutput_dir=.' ]
[main]  gyp info spawn make
[main]  gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
[main]  make: Entering directory '/node_modules/bluetooth-hci-socket/build'
[main]    CXX(target) Release/obj.target/binding/src/BluetoothHciSocket.o
[main]  ../src/BluetoothHciSocket.cpp: In member function ‘void BluetoothHciSocket::poll()’:
[main]  ../src/BluetoothHciSocket.cpp:251:95: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:950) [-Wdeprecated-declarations]
[main]       Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New(\"emit\").ToLocalChecked(), 2, argv);
[main]                                                                                                 ^
[main]  ../src/BluetoothHciSocket.cpp: In member function ‘void BluetoothHciSocket::emitErrnoError()’:
[main]  ../src/BluetoothHciSocket.cpp:275:72: error: no matching function for call to ‘v8::Function::NewInstance(int, v8::Local<v8::Value> [1])’
[main]     Local<Value> error = errorConstructor->NewInstance(1, constructorArgs);
[main]                                                                          ^
[main]  ../src/BluetoothHciSocket.cpp:275:72: note: candidates are:
[main]  In file included from /root/.node-gyp/10.0.0/include/node/node.h:63:0,
[main]                   from /root/.node-gyp/10.0.0/include/node/node_buffer.h:25,
[main]                   from ../src/BluetoothHciSocket.cpp:7:
[main]  /root/.node-gyp/10.0.0/include/node/v8.h:3848:44: note: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>, int, v8::Local<v8::Value>*) const
[main]     V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
[main]                                              ^
[main]  /root/.node-gyp/10.0.0/include/node/v8.h:3848:44: note:   candidate expects 3 arguments, 2 provided
[main]  /root/.node-gyp/10.0.0/include/node/v8.h:3851:44: note: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const
[main]     V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
[main]                                              ^
[main]  /root/.node-gyp/10.0.0/include/node/v8.h:3851:44: note:   candidate expects 1 argument, 2 provided
[main]  ../src/BluetoothHciSocket.cpp:282:93: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:950) [-Wdeprecated-declarations]
[main]     Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New(\"emit\").ToLocalChecked(), 2, argv);
[main]                                                                                               ^
[main]  binding.target.mk:93: recipe for target 'Release/obj.target/binding/src/BluetoothHciSocket.o' failed
[main]  make: *** [Release/obj.target/binding/src/BluetoothHciSocket.o] Error 1
[main]  make: Leaving directory '/node_modules/bluetooth-hci-socket/build'
[main]  gyp ERR! build error
[main]  gyp ERR! stack Error: `make` failed with exit code: 2
[main]  gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
[main]  gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
[main]  gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
[main]  gyp ERR! System Linux 4.12.13
[main]  gyp ERR! command \"/usr/local/bin/node\" \"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"
[main]  gyp ERR! cwd /node_modules/bluetooth-hci-socket
[main]  gyp ERR! node -v v10.0.0
[main]  gyp ERR! node-gyp -v v3.6.2
[main]  gyp ERR! not ok"

@ghost
Copy link

ghost commented Jun 18, 2018

@kounch : I submitted what you wrote as PR here: #91 , but you should probably submit it yourself. Once you do so, i'll delete this one.

@AlCalzone
Copy link

Any news on this? This prevents a couple of our projects to support Node 10.

@rzr
Copy link

rzr commented Nov 8, 2018

Any progress on this ?
Now node-10 is LTS so I guess it is more than welcome.

Current workaround is:

npm install "https://github.com/jrobeson/node-bluetooth-hci-socket/#fix-builds-for-node-10" # worked

What is blocking ? I can help on it if needed...

Relate-to: WebThingsIO/gateway#1441

@Apollon77
Copy link

Any news here? it is very important for all projects that care about full nodejs support or to use current versions! What is so problematic here?

@ghost
Copy link

ghost commented Nov 26, 2018

there's nothing problematic. the maintainer is just not around.

@ghost
Copy link

ghost commented Nov 26, 2018

I've considered forking it, but I haven't wanted to maintain it alone.

@AlCalzone
Copy link

there's nothing problematic. the maintainer is just not around.

That does sound kinda problematic ;)

@rzr
Copy link

rzr commented Nov 26, 2018

Do you know existing github/npm team that could do co maintenance on this module ?

If none may I suggest to move this project to:
https://github.com/abandonware

@ghost
Copy link

ghost commented Nov 26, 2018

@AlCalzone : i meant there's nothing problematic with the PR itself :)

@barcating
Copy link

I'm also getting this error.
/home/barcating/.node-gyp/11.3.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATED’
declarator attribute((deprecated(message)))
^
binding.target.mk:101: recipe for target 'Release/obj.target/binding/src/BluetoothHciSocket.o' failed
make: *** [Release/obj.target/binding/src/BluetoothHciSocket.o] Error 1
make: Leaving directory '/home/barcating/SDR/bluetooth/gattacker/node_modules/bluetooth-hci-socket/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Linux 4.13.0-36-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/barcating/SDR/bluetooth/gattacker/node_modules/bluetooth-hci-socket
gyp ERR! node -v v11.3.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

@barcating
Copy link

Any progress on this ?
Now node-10 is LTS so I guess it is more than welcome.

Current workaround is:

npm install "https://github.com/jrobeson/node-bluetooth-hci-socket/#fix-builds-for-node-10" # worked

What is blocking ? I can help on it if needed...

Relate-to: mozilla-iot/gateway#1441

Thanks!It worked.

@rzr
Copy link

rzr commented Nov 29, 2018

So please vote for:
#91

@Apollon77
Copy link

Hey All,

because also we are very dependent on this library I plan to do the following:
I will create a fork of this library, I am happy to accept node10 compatibility PRs on this fork and will then publish the node10 compatible version as "bluetooth-hci-socket2" to npm.

I will not accept feature additions, bugfixes we need to see because it's only for the node 10+ compatibility. I still hope that the original library gets a new maintainer that will continue the work or the original maintainer finds time again (no offense).

After the release all project that want can change their dep to the new library till the old is reactivated,

I post this here to get your opinion or objections against this idea, but we are blocked because of this.

So, what do you think?
Or do someone else want to do something like thin? ;-)

@rzr
Copy link

rzr commented Dec 14, 2018

I forked it in:
https://github.com/abandonware/node-bluetooth-hci-socket
if anyone want to co maintain it let me know to and join the team

Then it could be released in NPM's org subrepo ?

rzr pushed a commit to abandonware/node-bluetooth-hci-socket that referenced this issue Dec 14, 2018
This fix comes from
noble#84 (comment)
,  so I can't personally vouch for it.

Change-Id: Ifde2a3b996ab89a4b12b0eb155c081aca2b11dc3
Origin: https://github.com/jrobeson/node-bluetooth-hci-socket
Forwarded: noble#91
@Apollon77
Copy link

@rzr great idea! Thank you for taking the idea over! For NPM release I have no idea whats best.

BTW: In theory wealso would need to fork noble the same way because it is used there too and many users are directly using noble ... What do you think?

@Apollon77
Copy link

@rzr: Who can activate travis/appveyor for this repo so that we still have tests? Or do we need to fix that with own repo forks?

@rzr
Copy link

rzr commented Dec 14, 2018

I activated my travis for:
https://travis-ci.org/abandonware/node-bluetooth-hci-socket

Can you take care of appveyor ?

If there are other pendant relevant patches let it know at:

Then we'll see how to publish a fixed npm for node10:
#85

@rzr rzr mentioned this issue Dec 14, 2018
@Apollon77
Copy link

I would need to be in the project to activate appveyor :-( Then you need to ssign me rights/invite me.
ELse Appveyor is also easy ... go https://appveyor.com and Login with Github and Add Project :-)

@rzr
Copy link

rzr commented Dec 14, 2018

I invited you to join
https://github.com/orgs/abandonware/people

@Apollon77
Copy link

Got nothing so far and link shows only that I can not see anything :-)

@ghost
Copy link

ghost commented Dec 22, 2018

@th317erd : are you familiar with node's n-api? It'd be nice to convert the addon to n-api so the module will work across different node versions. We could go with plain C via n-api itself, or C++ via node-addon-api.

@th317erd
Copy link

No, I am not familiar with n-api, or V8 interfaces. However, I am good with C/C++, which is why I offered. I will take a look @rzr and @jrobeson when I get a free moment. @rzr was there anything specific you wanted me to test?

rzr added a commit to abandonware/noble that referenced this issue Aug 2, 2019
Abandonware namespace was used

Update bluetooth-hci-socket for node-10

Relate-to: noble/node-bluetooth-hci-socket#84
Origin: #1
Change-Id: Ib32f0c00bb0e7dcb9a125261cd9db0d11c440c21
Signed-off-by: Philippe Coval <p.coval@samsung.com>
@janhaa
Copy link

janhaa commented Sep 16, 2019

Issue was just fixed in abandonware#5 :-)

@rzr
Copy link

rzr commented Sep 17, 2019

And released To npm

@maxbellec
Copy link

npm install @abandonware/noble

works for me

@rzr
Copy link

rzr commented Nov 14, 2019

Please also review:
#105
Then I will try to upstream more abandonware patches once this one is merged

Please review open PR to:
https://github.com/abandonware

bitcloud pushed a commit to cospired/noble that referenced this issue Sep 21, 2020
Abandonware namespace was used

Update bluetooth-hci-socket for node-10

Relate-to: noble/node-bluetooth-hci-socket#84
Origin: abandonware#1
Change-Id: Ib32f0c00bb0e7dcb9a125261cd9db0d11c440c21
Signed-off-by: Philippe Coval <p.coval@samsung.com>
@rzr
Copy link

rzr commented Jan 6, 2021

Feel free to comment this related ticket:

abandonware#9

@rzr
Copy link

rzr commented Oct 1, 2021

May you forward your ticket to downstream version if relevant or confirm @abandonware version match your requirements here:

#123

@Liu-Jinshuai
Copy link

npm i bleno2

You can try this. It works well on my Linux. It has not been tested on other platforms. I hope it will help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests