peterbraden / node-opencv

OpenCV Bindings for node.js
MIT License
4.37k stars 858 forks source link

src: FaceRecognizer.cc: fix FTBFS on nodejs 14 #686

Closed grandpaul closed 1 year ago

grandpaul commented 2 years ago

When building on Debian with nodejs 14, we got the following error: src/FaceRecognizer.cc:202:74: error: base operand of '->' has non-pointer type 'v8::MaybeLocal' src/FaceRecognizer.cc:206:56: error: base operand of '->' has non-pointer type 'v8::MaybeLocal' src/FaceRecognizer.cc:207:50: error: could not convert '((v8::Object*)valarr.v8::Local::operator->())-> v8::Object::Get(Nan::GetCurrentContext(), 1)' from 'v8::MaybeLocal' to 'v8::Local'

This commit use .ToLocalChecked() to convert v8::MaybeLocal to v8::Local

Signed-off-by: Ying-Chun Liu (PaulLiu) paulliu@debian.org

grandpaul commented 2 years ago

After apply this commit, I can build without problems. And all the tests are still passed.

fredericgermain commented 2 years ago

+1 for this one

I'm on Ubuntu 20.04 with node 10 by default, but actually using node 14 wth nvm or more recent even for electron integration.

Could we have a new release ?~ This branch seems to fix npm audit too.

iongion commented 1 year ago

Can this be merged ? Unable to use on linux without it. node 18 - after fix all seems to work.