Node-red-contrib-midi fails to install from Manage palette under Linux (Ubuntu 21.10)

Hi,

I'm running Node-RED v2.1.3 on Ubuntu 21.10 (GNU/Linux 5.13.0-1010-raspi aarch64) and I get the following error log when trying to install this module. I'm pretty new to Linux and Node-RED and can't make any sense of what this is telling me, so any help would be appreciated. Thanks


-----------------------------------------------------------
2021-11-24T17:25:17.995Z Install : node-red-contrib-midi 1.0.1

2021-11-24T17:25:18.076Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-midi@1.0.1
2021-11-24T17:25:26.229Z [out] 
2021-11-24T17:25:26.229Z [out] > midi@0.9.5 install /home/ubuntu/.node-red/node_modules/midi
2021-11-24T17:25:26.229Z [out] > node-gyp rebuild
2021-11-24T17:25:26.229Z [out] 
2021-11-24T17:25:28.310Z [out] make: Entering directory '/home/ubuntu/.node-red/node_modules/midi/build'
2021-11-24T17:25:28.340Z [out]   CXX(target) Release/obj.target/midi/src/node-midi.o
2021-11-24T17:25:32.112Z [err] ../src/node-midi.cpp:14:26: error: ‘v8::Handle’ has not been declared
2021-11-24T17:25:32.112Z [err]    14 |     static void Init(v8::Handle<v8::Object> target)
2021-11-24T17:25:32.112Z [err]       |                          ^~~~~~
2021-11-24T17:25:32.112Z [err] ../src/node-midi.cpp:14:32: error: expected ‘,’ or ‘...’ before ‘<’ token
2021-11-24T17:25:32.112Z [err]    14 |     static void Init(v8::Handle<v8::Object> target)
2021-11-24T17:25:32.112Z [err]       |                                ^
2021-11-24T17:25:32.146Z [err] ../src/node-midi.cpp: In static member function ‘static void NodeMidiOutput::Init(int)’:
2021-11-24T17:25:32.146Z [err] ../src/node-midi.cpp:33:9: error: ‘target’ was not declared in this scope
2021-11-24T17:25:32.146Z [err]    33 |         target->Set(Nan::New<v8::String>("output").ToLocalChecked(), t->GetFunction());
2021-11-24T17:25:32.146Z [err]       |         ^~~~~~
2021-11-24T17:25:32.146Z [err] ../src/node-midi.cpp:33:84: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
2021-11-24T17:25:32.146Z [err]    33 |         target->Set(Nan::New<v8::String>("output").ToLocalChecked(), t->GetFunction());
2021-11-24T17:25:32.146Z [err]       |                                                                      ~~~~~~~~~~~~~~^~
2021-11-24T17:25:32.149Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.149Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.149Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.149Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:6482:46: note: candidate: ‘v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)’
2021-11-24T17:25:32.149Z [err]  6482 |   V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
2021-11-24T17:25:32.149Z [err]       |                                              ^~~~~~~~~~~
2021-11-24T17:25:32.158Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:6482:46: note:   candidate expects 1 argument, 0 provided
2021-11-24T17:25:32.167Z [err] ../src/node-midi.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeMidiOutput::GetPortName(Nan::NAN_METHOD_ARGS_TYPE)’:
2021-11-24T17:25:32.167Z [err] ../src/node-midi.cpp:76:55: error: no matching function for call to ‘v8::Value::Uint32Value()’
2021-11-24T17:25:32.167Z [err]    76 |         unsigned int portNumber = info[0]->Uint32Value();
2021-11-24T17:25:32.167Z [err]       |                                   ~~~~~~~~~~~~~~~~~~~~^~
2021-11-24T17:25:32.167Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.167Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.167Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.167Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2866:41: note: candidate: ‘v8::Maybe<unsigned int> v8::Value::Uint32Value(v8::Local<v8::Context>) const’
2021-11-24T17:25:32.167Z [err]  2866 |   V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
2021-11-24T17:25:32.167Z [err]       |                                         ^~~~~~~~~~~
2021-11-24T17:25:32.167Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2866:41: note:   candidate expects 1 argument, 0 provided
2021-11-24T17:25:32.169Z [err] ../src/node-midi.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeMidiOutput::OpenPort(Nan::NAN_METHOD_ARGS_TYPE)’:
2021-11-24T17:25:32.169Z [err] ../src/node-midi.cpp:88:55: error: no matching function for call to ‘v8::Value::Uint32Value()’
2021-11-24T17:25:32.169Z [err]    88 |         unsigned int portNumber = info[0]->Uint32Value();
2021-11-24T17:25:32.169Z [err]       |                                   ~~~~~~~~~~~~~~~~~~~~^~
2021-11-24T17:25:32.169Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.169Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.169Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.169Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2866:41: note: candidate: ‘v8::Maybe<unsigned int> v8::Value::Uint32Value(v8::Local<v8::Context>) const’
2021-11-24T17:25:32.169Z [err]  2866 |   V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
2021-11-24T17:25:32.169Z [err]       |                                         ^~~~~~~~~~~
2021-11-24T17:25:32.169Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2866:41: note:   candidate expects 1 argument, 0 provided
2021-11-24T17:25:32.170Z [err] ../src/node-midi.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeMidiOutput::OpenVirtualPort(Nan::NAN_METHOD_ARGS_TYPE)’:
2021-11-24T17:25:32.170Z [err] ../src/node-midi.cpp:105:73: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::String>)’
2021-11-24T17:25:32.170Z [err]   105 |         std::string name(*v8::String::Utf8Value(info[0].As<v8::String>()));
2021-11-24T17:25:32.170Z [err]       |                                                                         ^
2021-11-24T17:25:32.171Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.171Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.171Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.171Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3287:5: note: candidate: ‘v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)’
2021-11-24T17:25:32.171Z [err]  3287 |     Utf8Value(Isolate* isolate, Local<v8::Value> obj);
2021-11-24T17:25:32.171Z [err]       |     ^~~~~~~~~
2021-11-24T17:25:32.171Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3287:5: note:   candidate expects 2 arguments, 1 provided
2021-11-24T17:25:32.172Z [err] ../src/node-midi.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeMidiOutput::SendMessage(Nan::NAN_METHOD_ARGS_TYPE)’:
2021-11-24T17:25:32.172Z [err] ../src/node-midi.cpp:127:58: error: no matching function for call to ‘v8::Value::ToObject()’
2021-11-24T17:25:32.172Z [err]   127 |         v8::Local<v8::Object> message = info[0]->ToObject();
2021-11-24T17:25:32.172Z [err]       |                                         ~~~~~~~~~~~~~~~~~^~
2021-11-24T17:25:32.172Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.172Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.172Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.172Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2822:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
2021-11-24T17:25:32.172Z [err]  2822 |   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
2021-11-24T17:25:32.172Z [err]       |                                            ^~~~~~~~
2021-11-24T17:25:32.172Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2822:44: note:   candidate expects 1 argument, 0 provided
2021-11-24T17:25:32.173Z [err] ../src/node-midi.cpp:128:45: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>)’
2021-11-24T17:25:32.173Z [err]   128 |         int32_t messageLength = message->Get(Nan::New<v8::String>("length").ToLocalChecked())->Int32Value();
2021-11-24T17:25:32.173Z [err]       |                                 ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-11-24T17:25:32.173Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.173Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.173Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.173Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
2021-11-24T17:25:32.173Z [err]  3717 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
2021-11-24T17:25:32.173Z [err]       |                                           ^~~
2021-11-24T17:25:32.173Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
2021-11-24T17:25:32.173Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
2021-11-24T17:25:32.173Z [err]  3720 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
2021-11-24T17:25:32.173Z [err]       |                                           ^~~
2021-11-24T17:25:32.173Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
2021-11-24T17:25:32.179Z [err] ../src/node-midi.cpp:131:49: error: no matching function for call to ‘v8::Object::Get(Nan::imp::IntegerFactory<v8::Integer>::return_t)’
2021-11-24T17:25:32.179Z [err]   131 |             messageOutput.push_back(message->Get(Nan::New<v8::Integer>(i))->Int32Value());
2021-11-24T17:25:32.179Z [err]       |                                     ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
2021-11-24T17:25:32.179Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.179Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.179Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.179Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
2021-11-24T17:25:32.179Z [err]  3717 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
2021-11-24T17:25:32.179Z [err]       |                                           ^~~
2021-11-24T17:25:32.179Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
2021-11-24T17:25:32.179Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
2021-11-24T17:25:32.179Z [err]  3720 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
2021-11-24T17:25:32.179Z [err]       |                                           ^~~
2021-11-24T17:25:32.179Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
2021-11-24T17:25:32.192Z [err] ../src/node-midi.cpp: At global scope:
2021-11-24T17:25:32.192Z [err] ../src/node-midi.cpp:158:26: error: ‘v8::Handle’ has not been declared
2021-11-24T17:25:32.192Z [err]   158 |     static void Init(v8::Handle<v8::Object> target)
2021-11-24T17:25:32.192Z [err]       |                          ^~~~~~
2021-11-24T17:25:32.192Z [err] ../src/node-midi.cpp:158:32: error: expected ‘,’ or ‘...’ before ‘<’ token
2021-11-24T17:25:32.192Z [err]   158 |     static void Init(v8::Handle<v8::Object> target)
2021-11-24T17:25:32.192Z [err]       |                                ^
2021-11-24T17:25:32.217Z [err] ../src/node-midi.cpp: In static member function ‘static void NodeMidiInput::Init(int)’:
2021-11-24T17:25:32.217Z [err] ../src/node-midi.cpp:177:9: error: ‘target’ was not declared in this scope
2021-11-24T17:25:32.217Z [err]   177 |         target->Set(Nan::New<v8::String>("input").ToLocalChecked(), t->GetFunction());
2021-11-24T17:25:32.217Z [err]       |         ^~~~~~
2021-11-24T17:25:32.219Z [err] ../src/node-midi.cpp:177:83: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
2021-11-24T17:25:32.219Z [err]   177 |         target->Set(Nan::New<v8::String>("input").ToLocalChecked(), t->GetFunction());
2021-11-24T17:25:32.219Z [err]       |                                                                     ~~~~~~~~~~~~~~^~
2021-11-24T17:25:32.219Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.219Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.219Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.219Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:6482:46: note: candidate: ‘v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)’
2021-11-24T17:25:32.219Z [err]  6482 |   V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
2021-11-24T17:25:32.219Z [err]       |                                              ^~~~~~~~~~~
2021-11-24T17:25:32.219Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:6482:46: note:   candidate expects 1 argument, 0 provided
2021-11-24T17:25:32.223Z [err] ../src/node-midi.cpp: In static member function ‘static void NodeMidiInput::EmitMessage(uv_async_t*)’:
2021-11-24T17:25:32.223Z [err] ../src/node-midi.cpp:198:68: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>)’
2021-11-24T17:25:32.223Z [err]   198 |         v8::Local<v8::Function> emitFunction = input->handle()->Get(Nan::New<v8::String>(symbol_emit).ToLocalChecked()).As<v8::Function>();
2021-11-24T17:25:32.223Z [err]       |                                                ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-11-24T17:25:32.224Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.224Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.224Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.224Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
2021-11-24T17:25:32.224Z [err]  3717 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
2021-11-24T17:25:32.224Z [err]       |                                           ^~~
2021-11-24T17:25:32.224Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
2021-11-24T17:25:32.224Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
2021-11-24T17:25:32.224Z [err]  3720 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
2021-11-24T17:25:32.224Z [err]       |                                           ^~~
2021-11-24T17:25:32.224Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
2021-11-24T17:25:32.224Z [err] ../src/node-midi.cpp:198:136: error: expected primary-expression before ‘>’ token
2021-11-24T17:25:32.224Z [err]   198 |         v8::Local<v8::Function> emitFunction = input->handle()->Get(Nan::New<v8::String>(symbol_emit).ToLocalChecked()).As<v8::Function>();
2021-11-24T17:25:32.224Z [err]       |                                                                                                                                        ^
2021-11-24T17:25:32.224Z [err] ../src/node-midi.cpp:198:138: error: expected primary-expression before ‘)’ token
2021-11-24T17:25:32.224Z [err]   198 |         v8::Local<v8::Function> emitFunction = input->handle()->Get(Nan::New<v8::String>(symbol_emit).ToLocalChecked()).As<v8::Function>();
2021-11-24T17:25:32.224Z [err]       |                                                                                                                                          ^
2021-11-24T17:25:32.229Z [err] ../src/node-midi.cpp:208:26: error: no matching function for call to ‘v8::Array::Set(Nan::imp::FactoryBase<v8::Number>::return_t, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
2021-11-24T17:25:32.229Z [err]   208 |                 data->Set(Nan::New<v8::Number>(i), Nan::New<v8::Integer>(message->message[i]));
2021-11-24T17:25:32.229Z [err]       |                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-11-24T17:25:32.229Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.229Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.229Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.229Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3670:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
2021-11-24T17:25:32.229Z [err]  3670 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
2021-11-24T17:25:32.229Z [err]       |                                     ^~~
2021-11-24T17:25:32.229Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
2021-11-24T17:25:32.229Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3673:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
2021-11-24T17:25:32.229Z [err]  3673 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
2021-11-24T17:25:32.229Z [err]       |                                     ^~~
2021-11-24T17:25:32.229Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
2021-11-24T17:25:32.230Z [err] ../src/node-midi.cpp:211:30: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated [-Wdeprecated-declarations]
2021-11-24T17:25:32.230Z [err]   211 |             Nan::MakeCallback(input->handle(), emitFunction, 3, info);
2021-11-24T17:25:32.230Z [err]       |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-11-24T17:25:32.230Z [err] In file included from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.230Z [err] ../../nan/nan.h:1028:46: note: declared here
2021-11-24T17:25:32.230Z [err]  1028 |   NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
2021-11-24T17:25:32.230Z [err]       |                                              ^~~~~~~~~~~~
2021-11-24T17:25:32.234Z [err] ../src/node-midi.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeMidiInput::GetPortName(Nan::NAN_METHOD_ARGS_TYPE)’:
2021-11-24T17:25:32.234Z [err] ../src/node-midi.cpp:262:55: error: no matching function for call to ‘v8::Value::Uint32Value()’
2021-11-24T17:25:32.234Z [err]   262 |         unsigned int portNumber = info[0]->Uint32Value();
2021-11-24T17:25:32.234Z [err]       |                                   ~~~~~~~~~~~~~~~~~~~~^~
2021-11-24T17:25:32.235Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.235Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.235Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.235Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2866:41: note: candidate: ‘v8::Maybe<unsigned int> v8::Value::Uint32Value(v8::Local<v8::Context>) const’
2021-11-24T17:25:32.235Z [err]  2866 |   V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
2021-11-24T17:25:32.235Z [err]       |                                         ^~~~~~~~~~~
2021-11-24T17:25:32.235Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2866:41: note:   candidate expects 1 argument, 0 provided
2021-11-24T17:25:32.236Z [err] ../src/node-midi.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeMidiInput::OpenPort(Nan::NAN_METHOD_ARGS_TYPE)’:
2021-11-24T17:25:32.236Z [err] ../src/node-midi.cpp:274:55: error: no matching function for call to ‘v8::Value::Uint32Value()’
2021-11-24T17:25:32.236Z [err]   274 |         unsigned int portNumber = info[0]->Uint32Value();
2021-11-24T17:25:32.236Z [err]       |                                   ~~~~~~~~~~~~~~~~~~~~^~
2021-11-24T17:25:32.236Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.236Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.236Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.236Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2866:41: note: candidate: ‘v8::Maybe<unsigned int> v8::Value::Uint32Value(v8::Local<v8::Context>) const’
2021-11-24T17:25:32.236Z [err]  2866 |   V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
2021-11-24T17:25:32.236Z [err]       |                                         ^~~~~~~~~~~
2021-11-24T17:25:32.236Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2866:41: note:   candidate expects 1 argument, 0 provided
2021-11-24T17:25:32.238Z [err] ../src/node-midi.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeMidiInput::OpenVirtualPort(Nan::NAN_METHOD_ARGS_TYPE)’:
2021-11-24T17:25:32.238Z [err] ../src/node-midi.cpp:293:73: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::String>)’
2021-11-24T17:25:32.238Z [err]   293 |         std::string name(*v8::String::Utf8Value(info[0].As<v8::String>()));
2021-11-24T17:25:32.238Z [err]       |                                                                         ^
2021-11-24T17:25:32.238Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.238Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.238Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.238Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3287:5: note: candidate: ‘v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)’
2021-11-24T17:25:32.238Z [err]  3287 |     Utf8Value(Isolate* isolate, Local<v8::Value> obj);
2021-11-24T17:25:32.238Z [err]       |     ^~~~~~~~~
2021-11-24T17:25:32.238Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:3287:5: note:   candidate expects 2 arguments, 1 provided
2021-11-24T17:25:32.240Z [err] ../src/node-midi.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeMidiInput::IgnoreTypes(Nan::NAN_METHOD_ARGS_TYPE)’:
2021-11-24T17:25:32.240Z [err] ../src/node-midi.cpp:322:50: error: no matching function for call to ‘v8::Value::BooleanValue()’
2021-11-24T17:25:32.240Z [err]   322 |         bool filter_sysex = info[0]->BooleanValue();
2021-11-24T17:25:32.240Z [err]       |                             ~~~~~~~~~~~~~~~~~~~~~^~
2021-11-24T17:25:32.240Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.240Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.240Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.240Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2858:8: note: candidate: ‘bool v8::Value::BooleanValue(v8::Isolate*) const’
2021-11-24T17:25:32.240Z [err]  2858 |   bool BooleanValue(Isolate* isolate) const;
2021-11-24T17:25:32.240Z [err]       |        ^~~~~~~~~~~~
2021-11-24T17:25:32.240Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2858:8: note:   candidate expects 1 argument, 0 provided
2021-11-24T17:25:32.240Z [err] ../src/node-midi.cpp:323:51: error: no matching function for call to ‘v8::Value::BooleanValue()’
2021-11-24T17:25:32.240Z [err]   323 |         bool filter_timing = info[1]->BooleanValue();
2021-11-24T17:25:32.240Z [err]       |                              ~~~~~~~~~~~~~~~~~~~~~^~
2021-11-24T17:25:32.240Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.240Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.240Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.240Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2858:8: note: candidate: ‘bool v8::Value::BooleanValue(v8::Isolate*) const’
2021-11-24T17:25:32.240Z [err]  2858 |   bool BooleanValue(Isolate* isolate) const;
2021-11-24T17:25:32.240Z [err]       |        ^~~~~~~~~~~~
2021-11-24T17:25:32.240Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2858:8: note:   candidate expects 1 argument, 0 provided
2021-11-24T17:25:32.240Z [err] ../src/node-midi.cpp:324:52: error: no matching function for call to ‘v8::Value::BooleanValue()’
2021-11-24T17:25:32.240Z [err]   324 |         bool filter_sensing = info[2]->BooleanValue();
2021-11-24T17:25:32.240Z [err]       |                               ~~~~~~~~~~~~~~~~~~~~~^~
2021-11-24T17:25:32.240Z [err] In file included from /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:67,
2021-11-24T17:25:32.240Z [err]                  from ../../nan/nan.h:58,
2021-11-24T17:25:32.240Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.240Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2858:8: note: candidate: ‘bool v8::Value::BooleanValue(v8::Isolate*) const’
2021-11-24T17:25:32.240Z [err]  2858 |   bool BooleanValue(Isolate* isolate) const;
2021-11-24T17:25:32.240Z [err]       |        ^~~~~~~~~~~~
2021-11-24T17:25:32.240Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/v8.h:2858:8: note:   candidate expects 1 argument, 0 provided
2021-11-24T17:25:32.241Z [err] ../src/node-midi.cpp: At global scope:
2021-11-24T17:25:32.241Z [err] ../src/node-midi.cpp:334:10: error: variable or field ‘init’ declared void
2021-11-24T17:25:32.241Z [err]   334 |     void init (v8::Handle<v8::Object> target)
2021-11-24T17:25:32.241Z [err]       |          ^~~~
2021-11-24T17:25:32.242Z [err] ../src/node-midi.cpp:334:20: error: ‘Handle’ is not a member of ‘v8’; did you mean ‘JobHandle’?
2021-11-24T17:25:32.242Z [err]   334 |     void init (v8::Handle<v8::Object> target)
2021-11-24T17:25:32.242Z [err]       |                    ^~~~~~
2021-11-24T17:25:32.242Z [err]       |                    JobHandle
2021-11-24T17:25:32.242Z [err] ../src/node-midi.cpp:334:37: error: expected primary-expression before ‘>’ token
2021-11-24T17:25:32.242Z [err]   334 |     void init (v8::Handle<v8::Object> target)
2021-11-24T17:25:32.242Z [err]       |                                     ^
2021-11-24T17:25:32.255Z [err] ../src/node-midi.cpp:334:39: error: ‘target’ was not declared in this scope
2021-11-24T17:25:32.255Z [err]   334 |     void init (v8::Handle<v8::Object> target)
2021-11-24T17:25:32.255Z [err]       |                                       ^~~~~~
2021-11-24T17:25:32.267Z [err] In file included from ../../nan/nan.h:58,
2021-11-24T17:25:32.267Z [err]                  from ../src/node-midi.cpp:1:
2021-11-24T17:25:32.267Z [err] ../src/node-midi.cpp:339:23: error: ‘init’ was not declared in this scope; did you mean ‘int’?
2021-11-24T17:25:32.267Z [err]   339 |     NODE_MODULE(midi, init)
2021-11-24T17:25:32.267Z [err]       |                       ^~~~
2021-11-24T17:25:32.267Z [err] /home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:787:36: note: in definition of macro ‘NODE_MODULE_X’
2021-11-24T17:25:32.267Z [err]   787 |       (node::addon_register_func) (regfunc),                          \
2021-11-24T17:25:32.267Z [err]       |                                    ^~~~~~~
2021-11-24T17:25:32.267Z [err] ../src/node-midi.cpp:339:5: note: in expansion of macro ‘NODE_MODULE’
2021-11-24T17:25:32.267Z [err]   339 |     NODE_MODULE(midi, init)
2021-11-24T17:25:32.267Z [err]       |     ^~~~~~~~~~~
2021-11-24T17:25:32.690Z [err] In file included from ../src/node-midi.cpp:6:
2021-11-24T17:25:32.690Z [err] ../src/lib/RtMidi/RtMidi.cpp: In function ‘void* alsaMidiHandler(void*)’:
2021-11-24T17:25:32.690Z [err] ../src/lib/RtMidi/RtMidi.cpp:1228:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
2021-11-24T17:25:32.690Z [err]  1228 |       if ( ev->data.ext.len > apiData->bufferSize ) {
2021-11-24T17:25:32.690Z [err]       |       ^~
2021-11-24T17:25:32.690Z [err] ../src/lib/RtMidi/RtMidi.cpp:1239:5: note: here
2021-11-24T17:25:32.690Z [err]  1239 |     default:
2021-11-24T17:25:32.690Z [err]       |     ^~~~~~~
2021-11-24T17:25:32.775Z [err] make: *** [midi.target.mk:111: Release/obj.target/midi/src/node-midi.o] Error 1
2021-11-24T17:25:32.775Z [out] make: Leaving directory '/home/ubuntu/.node-red/node_modules/midi/build'
2021-11-24T17:25:32.778Z [err] gyp
2021-11-24T17:25:32.779Z [err]  
2021-11-24T17:25:32.779Z [err] ERR! build error 
2021-11-24T17:25:32.781Z [err] gyp 
2021-11-24T17:25:32.781Z [err] ERR! stack
2021-11-24T17:25:32.781Z [err]  Error: `make` failed with exit code: 2
2021-11-24T17:25:32.781Z [err] gyp
2021-11-24T17:25:32.781Z [err]  ERR! stack
2021-11-24T17:25:32.781Z [err]      at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
2021-11-24T17:25:32.781Z [err] gyp 
2021-11-24T17:25:32.781Z [err] ERR! 
2021-11-24T17:25:32.781Z [err] stack     at ChildProcess.emit (events.js:400:28)
2021-11-24T17:25:32.781Z [err] gyp
2021-11-24T17:25:32.781Z [err]  ERR! 
2021-11-24T17:25:32.782Z [err] stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
2021-11-24T17:25:32.782Z [err] gyp 
2021-11-24T17:25:32.782Z [err] ERR! System Linux 5.13.0-1010-raspi
2021-11-24T17:25:32.782Z [err] gyp
2021-11-24T17:25:32.783Z [err]  ERR! command
2021-11-24T17:25:32.783Z [err]  "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2021-11-24T17:25:32.783Z [err] gyp
2021-11-24T17:25:32.783Z [err]  ERR! 
2021-11-24T17:25:32.783Z [err] cwd /home/ubuntu/.node-red/node_modules/midi
2021-11-24T17:25:32.783Z [err] gyp ERR! 
2021-11-24T17:25:32.783Z [err] node -v v14.18.1
2021-11-24T17:25:32.783Z [err] gyp ERR! node-gyp -v
2021-11-24T17:25:32.783Z [err]  v5.1.0
2021-11-24T17:25:32.783Z [err] gyp
2021-11-24T17:25:32.784Z [err]  ERR! not ok 
2021-11-24T17:25:33.145Z [err] npm
2021-11-24T17:25:33.145Z [err]  ERR! code
2021-11-24T17:25:33.145Z [err]  ELIFECYCLE
2021-11-24T17:25:33.145Z [err] npm 
2021-11-24T17:25:33.146Z [err] ERR! errno 1
2021-11-24T17:25:33.174Z [err] npm
2021-11-24T17:25:33.174Z [err]  ERR! midi@0.9.5 install: `node-gyp rebuild`
2021-11-24T17:25:33.174Z [err] npm ERR!
2021-11-24T17:25:33.174Z [err]  Exit status 1
2021-11-24T17:25:33.174Z [err] npm ERR! 
2021-11-24T17:25:33.174Z [err] npm ERR!
2021-11-24T17:25:33.174Z [err]  Failed at the midi@0.9.5 install script.
2021-11-24T17:25:33.174Z [err] npm 
2021-11-24T17:25:33.174Z [err] ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-11-24T17:25:33.201Z [err] 
2021-11-24T17:25:33.201Z [err] npm ERR! A complete log of this run can be found in:
2021-11-24T17:25:33.201Z [err] npm
2021-11-24T17:25:33.201Z [err]  ERR!     /home/ubuntu/.npm/_logs/2021-11-24T17_25_33_178Z-debug.log
2021-11-24T17:25:33.230Z rc=1

Welcome to the forum @HonestJohn61

If you look at the page for the node on the node red flows site you will see it has not been updated for four years. If you then follow the link to the node's GitHub page and look at the issues tab you will see unaddressed issues saying that the node will not install on current versions of nodejs. I am afraid the node is abandoned so you will have to look for an alternative.

If you discover a node that is this broken (won't install and clear evidence it isn't just you!) then please use the 'report module' link on its flow library page. That allows us to take a look and remove it from the library. There's nothing to gain from having broken nodes in the library.

I have confirmed for myself that it will not build, and reported the module as suggested.

Thanks @Colin and @knolleary for checking this out. Look like I need to find another means of sending/receiving midi from Node-RED

Hi Thanks @Colin and @knolleary

Trying to find something else led me to the GitHub page for the module, and some references to there being a workaround/solution. As you can see I've just messaged the two participants to a dialogue earlier this year, but have yet to hear back.

Does what they're saying make sense to you? How do I go about fixing "the dependency version for midi in package.json" as I don't know what I'd need to do? Or has it actually already been done according to this page? And if it has, what do I need to do to make use of the fix?

Well the latest version of the midi package is 2.0.0 - so it would be better to move to that if anything...

Thanks @dceejay. Sounds good - but where do I find that? And how do I install it?

sorry - that is the underlying library referenced in that node, and the fix you show just bumps it to 1.4. I'm saying it would be better to re-fix it to use version 2.

Understood @dceejay. I found version 2.0.0 on GitHub and ran the following. Do you mind if I ask you whether these warnings below are troublesome or not? And if I have installed 2.0.0 successfully, how might I go about setting up the nodes in Node-RED? Thanks

ubuntu@ubuntu:~/node-midi$ npm install midi

> midi@2.0.0 install /home/ubuntu/node-midi/node_modules/midi
> node-gyp rebuild

make: Entering directory '/home/ubuntu/node-midi/node_modules/midi/build'
  CXX(target) Release/obj.target/midi/vendor/rtmidi/RtMidi.o
  CXX(target) Release/obj.target/midi/src/input.o
../src/input.cpp: In static member function ‘static void NodeMidiInput::EmitMessage(uv_async_t*)’:
../src/input.cpp:91:27: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]
   91 |         callback_emit.Call(input->handle(), 3, info);
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/input.cpp:1:
../../nan/nan.h:1722:3: note: declared here
 1722 |   Call(v8::Local<v8::Object> target
      |   ^~~~
  CXX(target) Release/obj.target/midi/src/output.o
  CXX(target) Release/obj.target/midi/src/midi.o
In file included from ../../nan/nan.h:58,
                 from ../src/midi.cpp:1:
/home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:787:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
  787 |       (node::addon_register_func) (regfunc),                          \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/.cache/node-gyp/14.18.1/include/node/node.h:821:3: note: in expansion of macro ‘NODE_MODULE_X’
  821 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/midi.cpp:14:1: note: in expansion of macro ‘NODE_MODULE’
   14 | NODE_MODULE(midi, InitAll)
      | ^~~~~~~~~~~
  SOLINK_MODULE(target) Release/obj.target/midi.node
  COPY Release/midi.node
make: Leaving directory '/home/ubuntu/node-midi/node_modules/midi/build'
npm WARN saveError ENOENT: no such file or directory, open '/home/ubuntu/node-midi/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/ubuntu/node-midi/package.json'
npm WARN node-midi No description
npm WARN node-midi No repository field.
npm WARN node-midi No README data
npm WARN node-midi No license field.

+ midi@2.0.0
added 4 packages from 14 contributors and audited 4 packages in 24.157s
found 0 vulnerabilities

ubuntu@ubuntu:~/node-midi$ dir -l
total 8
drwxrwxr-x 6 ubuntu ubuntu 4096 Nov 25 13:14 node_modules
-rw-rw-r-- 1 ubuntu ubuntu 1203 Nov 25 13:14 package-lock.json

Well that looks like it installed fine

You have installed in the wrong folder, you should be in the .node-red folder, but also you have just installed the midi module. You need to fork, or clone, the contrib node, edit the package.json file to pull in the later midi module, and then install your edited version.

Thanks @dceejay and @Colin

So I guess the first thing I need to do is uninstall the version I've already installed? I tried 'npm uninstall midi' but it only uninstalled 1 package, whereas 4 were installed in the first place. Does that matter? Should I just delete the /node-midi folder or does that cause more problems?

And once that's done, can I confirm my steps are:

  1. Create a new /node-midi folder under the .node-red folder (simple)
  2. Clone GitHub - urbiworx/node-red-contrib-midi to that new folder (I know how to do this)
  3. Edit the package.json file to refer to version 2.0.0 of midi (I'll find out how to do this when I try!)
  4. Install the edited version (Not sure how to do this. Presumably a command line instruction run in the /node-midi folder rather than something through Manage palette?)

Many thanks for all the help.

You installed it in the wrong folder in the first place so it doesn't matter.

No, clone it somewhere else entirely.

Go to your .node-red folder and run
npm install path/to/cloned/source

Then restart node-red

So I guess the first thing I need to do is uninstall the version I've already installed? I tried 'npm uninstall midi' but it only uninstalled 1 package, whereas 4 were installed in the first place. Does that matter? Should I just delete the /node-midi folder or does that cause more problems?

Well, 'npm install midi' installed three other packages as well as midi in subdirectories of node-modules, so I guessed I just needed to do the 'npm uninstall [package name]' three more times. That seems to have worked, although 'npm uninstall bindings' removed an alarming 141 packages:

ubuntu@ubuntu:~/node-midi/node_modules$ npm uninstall bindings
npm WARN saveError ENOENT: no such file or directory, open '/home/ubuntu/node-midi/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/ubuntu/node-midi/package.json'
npm WARN node-midi No description
npm WARN node-midi No repository field.
npm WARN node-midi No README data
npm WARN node-midi No license field.

removed 141 packages and audited 2 packages in 4.145s
found 0 vulnerabilities

Hope that doesn't mean I've compromised my Linux installation ...

Thanks @Colin. On it now

That was the wrong node_modules folder (~/node-midi/node_modules). Node red (by default) uses the one in ~/.node-red/node_modules. Node red does not care anything about the one in ~/node-midi.

Thanks for all the support @Colin. Feel like I'm getting close, but not there yet. After following the process and restarting Noder-RED, here's what the Manage palette tells me:

The npm install didn't seem to have any scary messages:

ubuntu@ubuntu:/usr/lib/node_modules/node-red$ sudo npm install /home/ubuntu/node-red-contrib-midi
npm WARN lifecycle midi@2.0.0~install: cannot run in wd midi@2.0.0 node-gyp rebuild (wd=/home/ubuntu/node-red-contrib-midi/node_modules/midi)
+ node-red-contrib-midi@1.0.1
added 5 packages from 14 contributors and audited 302 packages in 6.239s

28 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

ubuntu@ubuntu:/usr/lib/node_modules/node-red$ node-red-restart
Restarted Node-RED

Any suggestions?

Why are you installing it there?

What do you mean? What is my .node-red folder if not this? Please be really specific if I'm to understand!!