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

Install Failed [ iNotify v1.4.4 | Node v13.5.0 | Node-Gyp v6.1.0 ] #75

Open
svarlitskiy opened this issue Apr 23, 2020 · 21 comments
Open

Comments

@svarlitskiy
Copy link

Tried to use npm install inotify

[email protected]
[email protected]
[email protected]

In file included from ../src/node_inotify.h:14,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
                                                              ^
In file included from ../src/bindings.cc:2:
../src/bindings.h: At global scope:
../src/bindings.h:10:27: error: ‘Handle’ has not been declared
    static void Initialize(Handle<Object> target);
                           ^~~~~~
../src/bindings.h:10:33: error: expected ‘,’ or ‘...’ before ‘<’ token
    static void Initialize(Handle<Object> target);
                                 ^
../src/bindings.cc:11:27: error: variable or field ‘Initialize’ declared void
  void Inotify::Initialize(Handle<Object> exports) {
                           ^~~~~~
../src/bindings.cc:11:27: error: ‘Handle’ was not declared in this scope
../src/bindings.cc:11:27: note: suggested alternative: ‘rand_r’
  void Inotify::Initialize(Handle<Object> exports) {
                           ^~~~~~
                           rand_r
../src/bindings.cc:11:40: error: expected primary-expression before ‘>’ token
  void Inotify::Initialize(Handle<Object> exports) {
                                        ^
../src/bindings.cc:11:42: error: ‘exports’ was not declared in this scope
  void Inotify::Initialize(Handle<Object> exports) {
                                          ^~~~~~~
../src/bindings.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeInotify::Inotify::AddWatch(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/bindings.cc:146:43: error: no matching function for call to ‘v8::Value::ToObject()’
   Local<Object> args_ = info[0]->ToObject();
                                           ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:2754:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^~~~~~~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:2754:44: note:   candidate expects 1 argument, 0 provided
../src/bindings.cc:149:27: error: no matching function for call to ‘v8::Object::Has(v8::Local<v8::String>&)’
   if (!args_->Has(path_sym)) {
                           ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3629:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
                                     ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3629:37: note:   candidate expects 2 arguments, 1 provided
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3635:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
                                     ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3635:37: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:154:31: error: no matching function for call to ‘v8::Object::Has(v8::Local<v8::String>&)’
   if (!args_->Has(callback_sym) ||
                               ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3629:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
                                     ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3629:37: note:   candidate expects 2 arguments, 1 provided
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3635:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
                                     ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3635:37: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:155:28: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>&)’
    !args_->Get(callback_sym)->IsFunction()) {
                            ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3594:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3594:43: note:   candidate expects 2 arguments, 1 provided
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3597:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3597:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:160:32: error: no matching function for call to ‘v8::Object::Has(v8::Local<v8::String>&)’
   if (!args_->Has(watch_for_sym)) {
                                ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3629:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
                                     ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3629:37: note:   candidate expects 2 arguments, 1 provided
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3635:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
                                     ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3635:37: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:163:33: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>&)’
    if (!args_->Get(watch_for_sym)->IsInt32()) {
                                 ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3594:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3594:43: note:   candidate expects 2 arguments, 1 provided
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3597:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3597:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:166:36: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>&)’
    mask |= args_->Get(watch_for_sym)->Int32Value();
                                    ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3594:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3594:43: note:   candidate expects 2 arguments, 1 provided
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3597:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3597:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:172:45: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>&)’
   String::Utf8Value path(args_->Get(path_sym));
                                             ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3594:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3594:43: note:   candidate expects 2 arguments, 1 provided
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3597:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3597:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:182:61: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>&)’
   inotify->handle()->Set(descriptor, args_->Get(callback_sym));
                                                             ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3594:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3594:43: note:   candidate expects 2 arguments, 1 provided
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3597:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3597:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeInotify::Inotify::RemoveWatch(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/bindings.cc:195:31: error: no matching function for call to ‘v8::Value::Int32Value()’
   watch = info[0]->Int32Value();
                               ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:2778:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^~~~~~~~~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:2778:40: note:   candidate expects 1 argument, 0 provided
../src/bindings.cc: In static member function ‘static void NodeInotify::Inotify::Callback(uv_poll_t*, int, int)’:
../src/bindings.cc:262:86: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
     obj->Set(Nan::New<String>("watch").ToLocalChecked(), Nan::New<Integer>(event->wd));
                                                                                      ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3547:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3547:37: note:   candidate expects 3 arguments, 2 provided
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3550:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                     ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3550:37: note:   candidate expects 3 arguments, 2 provided
../src/bindings.cc:263:87: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
     obj->Set(Nan::New<String>("mask").ToLocalChecked(), Nan::New<Integer>(event->mask));
                                                                                       ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3547:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3547:37: note:   candidate expects 3 arguments, 2 provided
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3550:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                     ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3550:37: note:   candidate expects 3 arguments, 2 provided
../src/bindings.cc:264:91: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
     obj->Set(Nan::New<String>("cookie").ToLocalChecked(), Nan::New<Integer>(event->cookie));
                                                                                           ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3547:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3547:37: note:   candidate expects 3 arguments, 2 provided
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3550:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                     ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3550:37: note:   candidate expects 3 arguments, 2 provided
../src/bindings.cc:267:104: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::String>)’
      obj->Set(Nan::New<String>("name").ToLocalChecked(), Nan::New<String>(event->name).ToLocalChecked());
                                                                                                        ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3547:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3547:37: note:   candidate expects 3 arguments, 2 provided
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3550:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                     ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3550:37: note:   candidate expects 3 arguments, 2 provided
../src/bindings.cc:275:66: error: no matching function for call to ‘v8::Object::Get(Nan::imp::IntegerFactory<v8::Integer>::return_t)’
     Local<Value> value = handle->Get(Nan::New<Integer>(event->wd));
                                                                  ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3594:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3594:43: note:   candidate expects 2 arguments, 1 provided
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3597:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:3597:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:279:34: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]
     callback.Call(handle, 1, argv);
                                  ^
In file included from ../src/node_inotify.h:14,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
../../nan/nan.h:1720:3: note: declared here
   Call(v8::Local<v8::Object> target
   ^~~~
../src/bindings.cc:285:34: error: no matching function for call to ‘v8::Value::ToString()’
      handle->Delete(wd->ToString());
                                  ^
In file included from /home/developer/.cache/node-gyp/13.5.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:2750:44: note: candidate: ‘v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                            ^~~~~~~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:2750:44: note:   candidate expects 1 argument, 0 provided
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/home/developer/.cache/node-gyp/13.5.0/include/node/node_object_wrap.h:84:78:   required from here
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:10400:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:65:61:   required from here
/home/developer/.cache/node-gyp/13.5.0/include/node/v8.h:10400:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
make: *** [inotify.target.mk:110: Release/obj.target/inotify/src/bindings.o] Error 1
make: Leaving directory '/home/developer/Projects/bdc/node_modules/inotify/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:305:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 4.19.0-8-amd64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/developer/Projects/bdc/node_modules/inotify
gyp ERR! node -v v13.5.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/developer/.npm/_logs/2020-04-23T22_35_50_073Z-debug.log
@jmattsson
Copy link

I'm seeing the same with inotify-1.4.6 / node-12.16.1 / node-gyp 5.0.5.

@jetibest
Copy link

jetibest commented Jul 14, 2020

Same errors using inotify-1.4.6, node v14.2.0, npm 6.14.5, node-gyp 6.1.0.

The pull request (repo: ashthespy/node-inotify) which should fix this failed with:

(...)
internal/modules/cjs/loader.js:1023
  throw err;
  ^

Error: Cannot find module 'nan'
Require stack:
- /mnt/.../node-inotify/[eval]
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1020:15)
    at Function.Module._load (internal/modules/cjs/loader.js:890:27)
    at Module.require (internal/modules/cjs/loader.js:1080:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at [eval]:1:1
    at Script.runInThisContext (vm.js:131:20)
    at Object.runInThisContext (vm.js:297:38)
    at Object.<anonymous> ([eval]-wrapper:10:26)
    at Module._compile (internal/modules/cjs/loader.js:1176:30)
    at evalScript (internal/process/execution.js:94:25) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/mnt/.../node-inotify/[eval]'
  ]
}
gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 5.6.11-arch1-1
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
(...)

So I had to run npm install nan in the node-inotify directory to resolve that problem. After node-gyp rebuild, the module is then loaded using: const Inotify = require('./node-inotify');.

In short, for Node v14 this should work:

git clone https://github.com/ashthespy/node-inotify.git
cd node-inotify
npm install nan
node-gyp rebuild
cd ..
node -e "const Inotify = require('./node-inotify').Inotify;console.log(Inotify);"

@paigeweber13
Copy link

For anyone else who discovered this issue after googling their error message, for me this was fixed by switching to node v11.14.0 (previously I was using v14.8.0). At the time of writing, the inotify readme states that only nodejs versions up to v11.x.x are supported.

@c4milo
Copy link
Owner

c4milo commented Aug 27, 2020

@rileyweber13, thanks for the extra clarification! We added support for Node 14 in 5d12f64 but, unfortunately, I haven't had time to properly test it before tagging a release.

@vbraun
Copy link

vbraun commented Nov 5, 2020

I'm getting the same error: ‘Handle’ has not been declared error with nodejs-14.14.0, for the record.

@ashthespy
Copy link
Contributor

@vbraun Is this running of the current master?

@vbraun
Copy link

vbraun commented Dec 8, 2020

No, that was with the latest release. Just tried with master and that builds:

$ podman run --rm -it fedora
# cat /etc/system-release
Fedora release 33 (Thirty Three)
# dnf groupinstall "Development Tools"
# dnf install -y nodejs gcc-g++
# node --version
v14.14.0
# npm install https://github.com/c4milo/node-inotify.git
[...]
+ [email protected]
added 4 packages from 18 contributors and audited 4 packages in 6.662s
found 0 vulnerabilities

@ashthespy
Copy link
Contributor

@c4milo Would you have some tests that could be run to confirm things work as expected after 5d12f64?
I just ran the example.js and fooled around a bit manually as my "test" 😅

@c4milo
Copy link
Owner

c4milo commented Dec 9, 2020

@ashthespy, that's what I've used as well. We should add proper tests.

@ashthespy
Copy link
Contributor

@c4milo any chance you could publish a new version? Node v14 is the current LTS, and would be nice not to have to depend on git version for this :-)

@lcofre
Copy link

lcofre commented Apr 23, 2021

I'm trying to install inotify using

npm 6.14.12
node v14.16.1
node-gyp 8.0.0

But I get this error:

$ npm i -g inotify

> [email protected] install /home/myuser/.nvm/versions/node/v14.16.1/lib/node_modules/inotify
> node-gyp rebuild

make: Entering directory '/home/myuser/.nvm/versions/node/v14.16.1/lib/node_modules/inotify/build'
  CXX(target) Release/obj.target/inotify/src/bindings.o
In file included from ../src/bindings.cc:2:
../src/bindings.h:10:27: error: ‘Handle’ has not been declared
   10 |    static void Initialize(Handle<Object> target);
      |                           ^~~~~~
../src/bindings.h:10:33: error: expected ‘,’ or ‘...’ before ‘<’ token
   10 |    static void Initialize(Handle<Object> target);
      |                                 ^
../src/bindings.cc:11:27: error: variable or field ‘Initialize’ declared void
   11 |  void Inotify::Initialize(Handle<Object> exports) {
      |                           ^~~~~~
../src/bindings.cc:11:27: error: ‘Handle’ was not declared in this scope
../src/bindings.cc:11:40: error: expected primary-expression before ‘>’ token
   11 |  void Inotify::Initialize(Handle<Object> exports) {
      |                                        ^
../src/bindings.cc:11:42: error: ‘exports’ was not declared in this scope
   11 |  void Inotify::Initialize(Handle<Object> exports) {
      |                                          ^~~~~~~
../src/bindings.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeInotify::Inotify::AddWatch(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/bindings.cc:146:43: error: no matching function for call to ‘v8::Value::ToObject()’
  146 |   Local<Object> args_ = info[0]->ToObject();
      |                                           ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:2822:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
 2822 |   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
      |                                            ^~~~~~~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:2822:44: note:   candidate expects 1 argument, 0 provided
../src/bindings.cc:149:27: error: no matching function for call to ‘v8::Object::Has(v8::Local<v8::String>&)’
  149 |   if (!args_->Has(path_sym)) {
      |                           ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3752:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)’
 3752 |   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
      |                                     ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3752:37: note:   candidate expects 2 arguments, 1 provided
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3758:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, uint32_t)’
 3758 |   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
      |                                     ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3758:37: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:154:31: error: no matching function for call to ‘v8::Object::Has(v8::Local<v8::String>&)’
  154 |   if (!args_->Has(callback_sym) ||
      |                               ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3752:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)’
 3752 |   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
      |                                     ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3752:37: note:   candidate expects 2 arguments, 1 provided
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3758:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, uint32_t)’
 3758 |   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
      |                                     ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3758:37: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:155:28: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>&)’
  155 |    !args_->Get(callback_sym)->IsFunction()) {
      |                            ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
 3717 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
      |                                           ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
 3720 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
      |                                           ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:160:32: error: no matching function for call to ‘v8::Object::Has(v8::Local<v8::String>&)’
  160 |   if (!args_->Has(watch_for_sym)) {
      |                                ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3752:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)’
 3752 |   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
      |                                     ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3752:37: note:   candidate expects 2 arguments, 1 provided
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3758:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, uint32_t)’
 3758 |   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
      |                                     ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3758:37: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:163:33: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>&)’
  163 |    if (!args_->Get(watch_for_sym)->IsInt32()) {
      |                                 ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
 3717 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
      |                                           ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
 3720 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
      |                                           ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:166:36: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>&)’
  166 |    mask |= args_->Get(watch_for_sym)->Int32Value();
      |                                    ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
 3717 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
      |                                           ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
 3720 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
      |                                           ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:172:45: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>&)’
  172 |   String::Utf8Value path(args_->Get(path_sym));
      |                                             ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
 3717 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
      |                                           ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
 3720 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
      |                                           ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:182:61: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>&)’
  182 |   inotify->handle()->Set(descriptor, args_->Get(callback_sym));
      |                                                             ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
 3717 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
      |                                           ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
 3720 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
      |                                           ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeInotify::Inotify::RemoveWatch(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/bindings.cc:195:31: error: no matching function for call to ‘v8::Value::Int32Value()’
  195 |   watch = info[0]->Int32Value();
      |                               ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:2869:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
 2869 |   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
      |                                        ^~~~~~~~~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:2869:40: note:   candidate expects 1 argument, 0 provided
../src/bindings.cc: In static member function ‘static void NodeInotify::Inotify::Callback(uv_poll_t*, int, int)’:
../src/bindings.cc:262:86: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
  262 |     obj->Set(Nan::New<String>("watch").ToLocalChecked(), Nan::New<Integer>(event->wd));
      |                                                                                      ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.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>)’
 3670 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/home/myuser/.cache/node-gyp/14.16.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>)’
 3673 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
      |                                     ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
../src/bindings.cc:263:87: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
  263 |     obj->Set(Nan::New<String>("mask").ToLocalChecked(), Nan::New<Integer>(event->mask));
      |                                                                                       ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.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>)’
 3670 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/home/myuser/.cache/node-gyp/14.16.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>)’
 3673 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
      |                                     ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
../src/bindings.cc:264:91: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
  264 |     obj->Set(Nan::New<String>("cookie").ToLocalChecked(), Nan::New<Integer>(event->cookie));
      |                                                                                           ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.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>)’
 3670 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/home/myuser/.cache/node-gyp/14.16.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>)’
 3673 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
      |                                     ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
../src/bindings.cc:267:104: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::String>)’
  267 |      obj->Set(Nan::New<String>("name").ToLocalChecked(), Nan::New<String>(event->name).ToLocalChecked());
      |                                                                                                        ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.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>)’
 3670 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/home/myuser/.cache/node-gyp/14.16.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>)’
 3673 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
      |                                     ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
../src/bindings.cc:275:66: error: no matching function for call to ‘v8::Object::Get(Nan::imp::IntegerFactory<v8::Integer>::return_t)’
  275 |     Local<Value> value = handle->Get(Nan::New<Integer>(event->wd));
      |                                                                  ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
 3717 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
      |                                           ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
 3720 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
      |                                           ^~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:279:34: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]
  279 |     callback.Call(handle, 1, argv);
      |                                  ^
In file included from ../src/node_inotify.h:14,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
../node_modules/nan/nan.h:1720:3: note: declared here
 1720 |   Call(v8::Local<v8::Object> target
      |   ^~~~
../src/bindings.cc:285:34: error: no matching function for call to ‘v8::Value::ToString()’
  285 |      handle->Delete(wd->ToString());
      |                                  ^
In file included from /home/myuser/.cache/node-gyp/14.16.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:2810:44: note: candidate: ‘v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const’
 2810 |   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
      |                                            ^~~~~~~~
/home/myuser/.cache/node-gyp/14.16.1/include/node/v8.h:2810:44: note:   candidate expects 1 argument, 0 provided
make: *** [inotify.target.mk:112: Release/obj.target/inotify/src/bindings.o] Error 1
make: Leaving directory '/home/myuser/.nvm/versions/node/v14.16.1/lib/node_modules/inotify/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/myuser/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 5.8.0-50-generic
gyp ERR! command "/home/myuser/.nvm/versions/node/v14.16.1/bin/node" "/home/myuser/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/myuser/.nvm/versions/node/v14.16.1/lib/node_modules/inotify
gyp ERR! node -v v14.16.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/myuser/.npm/_logs/2021-04-23T16_55_18_125Z-debug.log

@ashthespy
Copy link
Contributor

@rileyweber13, thanks for the extra clarification! We added support for Node 14 in 5d12f64 but, unfortunately, I haven't had time to properly test it before tagging a release.

@lcofre did you try building from master as suggested?

@c4milo
Copy link
Owner

c4milo commented Apr 24, 2021

Will try to push a new version tomorrow, apologies for the delay!

@lcofre
Copy link

lcofre commented Apr 24, 2021

Thanks for your answers guys!

When installing from master I get errors too, but it seems to install it. Could it be the version of npm, 6.14.12?

$ npm i -g https://github.com/c4milo/node-inotify.git

> [email protected] install /home/myuser/.nvm/versions/node/v12.18.2/lib/node_modules/inotify
> node-gyp rebuild

make: Entering directory '/home/myuser/.nvm/versions/node/v12.18.2/lib/node_modules/inotify/build'
  CXX(target) Release/obj.target/inotify/src/bindings.o
../src/bindings.cc: In static member function ‘static void NodeInotify::Inotify::Initialize(v8::Local<v8::Object>)’:
../src/bindings.cc:29:69: warning: ignoring return value of ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’, declared with attribute warn_unused_result [-Wunused-result]
   29 |   exports->Set(ctx, Nan::New<String>("Inotify").ToLocalChecked(), fn);
      |                                                                     ^
In file included from /home/myuser/.cache/node-gyp/12.18.2/include/node/node.h:67,
                 from ../src/node_inotify.h:15,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/12.18.2/include/node/v8.h:3504:37: note: declared here
 3504 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
../src/bindings.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeInotify::Inotify::AddWatch(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/bindings.cc:190:89: warning: ignoring return value of ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’, declared with attribute warn_unused_result [-Wunused-result]
  190 |   inotify->handle()->Set(ctx, descriptor, args_->Get(ctx, callback_sym).ToLocalChecked());
      |                                                                                         ^
In file included from /home/myuser/.cache/node-gyp/12.18.2/include/node/node.h:67,
                 from ../src/node_inotify.h:15,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/12.18.2/include/node/v8.h:3504:37: note: declared here
 3504 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
../src/bindings.cc: In static member function ‘static void NodeInotify::Inotify::Callback(uv_poll_t*, int, int)’:
../src/bindings.cc:274:91: warning: ignoring return value of ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’, declared with attribute warn_unused_result [-Wunused-result]
  274 |     obj->Set(ctx, Nan::New<String>("watch").ToLocalChecked(), Nan::New<Integer>(event->wd));
      |                                                                                           ^
In file included from /home/myuser/.cache/node-gyp/12.18.2/include/node/node.h:67,
                 from ../src/node_inotify.h:15,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/12.18.2/include/node/v8.h:3504:37: note: declared here
 3504 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
../src/bindings.cc:275:92: warning: ignoring return value of ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’, declared with attribute warn_unused_result [-Wunused-result]
  275 |     obj->Set(ctx, Nan::New<String>("mask").ToLocalChecked(), Nan::New<Integer>(event->mask));
      |                                                                                            ^
In file included from /home/myuser/.cache/node-gyp/12.18.2/include/node/node.h:67,
                 from ../src/node_inotify.h:15,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/12.18.2/include/node/v8.h:3504:37: note: declared here
 3504 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
../src/bindings.cc:276:96: warning: ignoring return value of ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’, declared with attribute warn_unused_result [-Wunused-result]
  276 |     obj->Set(ctx, Nan::New<String>("cookie").ToLocalChecked(), Nan::New<Integer>(event->cookie));
      |                                                                                                ^
In file included from /home/myuser/.cache/node-gyp/12.18.2/include/node/node.h:67,
                 from ../src/node_inotify.h:15,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/12.18.2/include/node/v8.h:3504:37: note: declared here
 3504 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
../src/bindings.cc:279:109: warning: ignoring return value of ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’, declared with attribute warn_unused_result [-Wunused-result]
  279 |      obj->Set(ctx, Nan::New<String>("name").ToLocalChecked(), Nan::New<String>(event->name).ToLocalChecked());
      |                                                                                                             ^
In file included from /home/myuser/.cache/node-gyp/12.18.2/include/node/node.h:67,
                 from ../src/node_inotify.h:15,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/12.18.2/include/node/v8.h:3504:37: note: declared here
 3504 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
../src/bindings.cc:297:60: warning: ignoring return value of ‘v8::Maybe<bool> v8::Object::Delete(v8::Local<v8::Context>, v8::Local<v8::Value>)’, declared with attribute warn_unused_result [-Wunused-result]
  297 |      handle->Delete(ctx, wd->ToString(ctx).ToLocalChecked());
      |                                                            ^
In file included from /home/myuser/.cache/node-gyp/12.18.2/include/node/node.h:67,
                 from ../src/node_inotify.h:15,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/myuser/.cache/node-gyp/12.18.2/include/node/v8.h:3593:37: note: declared here
 3593 |   V8_WARN_UNUSED_RESULT Maybe<bool> Delete(Local<Context> context,
      |                                     ^~~~~~
  CXX(target) Release/obj.target/inotify/src/node_inotify.o
../src/node_inotify.cc: In function ‘void NodeInotify::InitializeInotify(v8::Local<v8::Object>)’:
../src/node_inotify.cc:16:76: warning: ignoring return value of ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’, declared with attribute warn_unused_result [-Wunused-result]
   16 |                     Nan::New<String>(NODE_INOTIFY_VERSION).ToLocalChecked());
      |                                                                            ^
In file included from /home/myuser/.cache/node-gyp/12.18.2/include/node/node.h:67,
                 from ../src/node_inotify.h:15,
                 from ../src/bindings.h:4,
                 from ../src/node_inotify.cc:2:
/home/myuser/.cache/node-gyp/12.18.2/include/node/v8.h:3504:37: note: declared here
 3504 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
../src/node_inotify.cc:18:93: warning: ignoring return value of ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’, declared with attribute warn_unused_result [-Wunused-result]
   18 |         context->Global()->Set(context,Nan::New<String>("Inotify").ToLocalChecked(), exports);
      |                                                                                             ^
In file included from /home/myuser/.cache/node-gyp/12.18.2/include/node/node.h:67,
                 from ../src/node_inotify.h:15,
                 from ../src/bindings.h:4,
                 from ../src/node_inotify.cc:2:
/home/myuser/.cache/node-gyp/12.18.2/include/node/v8.h:3504:37: note: declared here
 3504 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
../src/node_inotify.cc:12:14: warning: unused variable ‘i’ [-Wunused-variable]
   12 |         auto i = v8::Isolate::GetCurrent();
      |              ^
In file included from ../src/node_inotify.h:15,
                 from ../src/bindings.h:4,
                 from ../src/node_inotify.cc:2:
../src/node_inotify.cc: At global scope:
/home/myuser/.cache/node-gyp/12.18.2/include/node/node.h:608:43: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
  608 |       (node::addon_register_func) (regfunc),                          \
      |                                           ^
/home/myuser/.cache/node-gyp/12.18.2/include/node/node.h:642:3: note: in expansion of macro ‘NODE_MODULE_X’
  642 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/node_inotify.cc:27:1: note: in expansion of macro ‘NODE_MODULE’
   27 | NODE_MODULE(inotify, NodeInotify::init)
      | ^~~~~~~~~~~
  SOLINK_MODULE(target) Release/obj.target/inotify.node
  COPY Release/inotify.node
make: Leaving directory '/home/myuser/.nvm/versions/node/v12.18.2/lib/node_modules/inotify/build'
+ [email protected]
added 4 packages from 18 contributors in 3.929s

@fominv
Copy link

fominv commented Jun 16, 2021

Getting similar errors as @lcofre.

  • linux debian
  • node version 14.17.1
  • npm version 6.14.13
npm install inotify

make: Entering directory '/home/example-user/example-project/frontend/node_modules/inotify/build'
  CXX(target) Release/obj.target/inotify/src/bindings.o
In file included from ../src/bindings.cc:2:
../src/bindings.h:10:27: error: ‘Handle’ has not been declared
    static void Initialize(Handle<Object> target);
                           ^~~~~~
../src/bindings.h:10:33: error: expected ‘,’ or ‘...’ before ‘<’ token
    static void Initialize(Handle<Object> target);
                                 ^
../src/bindings.cc:11:27: error: variable or field ‘Initialize’ declared void
  void Inotify::Initialize(Handle<Object> exports) {
                           ^~~~~~
../src/bindings.cc:11:27: error: ‘Handle’ was not declared in this scope
../src/bindings.cc:11:27: note: suggested alternative: ‘rand_r’
  void Inotify::Initialize(Handle<Object> exports) {
                           ^~~~~~
                           rand_r
../src/bindings.cc:11:40: error: expected primary-expression before ‘>’ token
  void Inotify::Initialize(Handle<Object> exports) {
                                        ^
../src/bindings.cc:11:42: error: ‘exports’ was not declared in this scope
  void Inotify::Initialize(Handle<Object> exports) {
                                          ^~~~~~~
../src/bindings.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeInotify::Inotify::AddWatch(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/bindings.cc:146:43: error: no matching function for call to ‘v8::Value::ToObject()’
   Local<Object> args_ = info[0]->ToObject();
                                           ^
In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:2822:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^~~~~~~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:2822:44: note:   candidate expects 1 argument, 0 provided
../src/bindings.cc:149:27: error: no matching function for call to ‘v8::Object::Has(v8::Local<v8::String>&)’
   if (!args_->Has(path_sym)) {
                           ^
In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3752:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
                                     ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3752:37: note:   candidate expects 2 arguments, 1 provided
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3758:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
                                     ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3758:37: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:154:31: error: no matching function for call to ‘v8::Object::Has(v8::Local<v8::String>&)’
   if (!args_->Has(callback_sym) ||
                               ^
In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3752:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
                                     ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3752:37: note:   candidate expects 2 arguments, 1 provided
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3758:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
                                     ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3758:37: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:155:28: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>&)’
    !args_->Get(callback_sym)->IsFunction()) {
                            ^
In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:160:32: error: no matching function for call to ‘v8::Object::Has(v8::Local<v8::String>&)’
   if (!args_->Has(watch_for_sym)) {
                                ^
In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3752:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
                                     ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3752:37: note:   candidate expects 2 arguments, 1 provided
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3758:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
                                     ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3758:37: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:163:33: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>&)’
    if (!args_->Get(watch_for_sym)->IsInt32()) {
                                 ^
In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:166:36: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>&)’
    mask |= args_->Get(watch_for_sym)->Int32Value();
                                    ^
In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:172:45: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>&)’
   String::Utf8Value path(args_->Get(path_sym));
                                             ^
In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:182:61: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>&)’
   inotify->handle()->Set(descriptor, args_->Get(callback_sym));
                                                             ^
In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeInotify::Inotify::RemoveWatch(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/bindings.cc:195:31: error: no matching function for call to ‘v8::Value::Int32Value()’
   watch = info[0]->Int32Value();
                               ^
In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:2869:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^~~~~~~~~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:2869:40: note:   candidate expects 1 argument, 0 provided
../src/bindings.cc: In static member function ‘static void NodeInotify::Inotify::Callback(uv_poll_t*, int, int)’:
../src/bindings.cc:262:86: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
     obj->Set(Nan::New<String>("watch").ToLocalChecked(), Nan::New<Integer>(event->wd));
                                                                                      ^
In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.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>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/home/example-user/.cache/node-gyp/14.17.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>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                     ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
../src/bindings.cc:263:87: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
     obj->Set(Nan::New<String>("mask").ToLocalChecked(), Nan::New<Integer>(event->mask));
                                                                                       ^
In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.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>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/home/example-user/.cache/node-gyp/14.17.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>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                     ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
../src/bindings.cc:264:91: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
     obj->Set(Nan::New<String>("cookie").ToLocalChecked(), Nan::New<Integer>(event->cookie));
                                                                                           ^
In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.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>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/home/example-user/.cache/node-gyp/14.17.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>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                     ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
../src/bindings.cc:267:104: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::String>)’
 et(Nan::New<String>("name").ToLocalChecked(), Nan::New<String>(event->name).ToLocalChecked());
                                                                                             ^

In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.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>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/home/example-user/.cache/node-gyp/14.17.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>)’
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                     ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
../src/bindings.cc:275:66: error: no matching function for call to ‘v8::Object::Get(Nan::imp::IntegerFactory<v8::Integer>::return_t)’
     Local<Value> value = handle->Get(Nan::New<Integer>(event->wd));
                                                                  ^
In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:279:34: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]
     callback.Call(handle, 1, argv);
                                  ^
In file included from ../src/node_inotify.h:14,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
../../nan/nan.h:1720:3: note: declared here
   Call(v8::Local<v8::Object> target
   ^~~~
../src/bindings.cc:285:34: error: no matching function for call to ‘v8::Value::ToString()’
      handle->Delete(wd->ToString());
                                  ^
In file included from /home/example-user/.cache/node-gyp/14.17.1/include/node/node.h:67,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:2810:44: note: candidate: ‘v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                            ^~~~~~~~
/home/example-user/.cache/node-gyp/14.17.1/include/node/v8.h:2810:44: note:   candidate expects 1 argument, 0 provided
make: *** [inotify.target.mk:112: Release/obj.target/inotify/src/bindings.o] Error 1
make: Leaving directory '/home/example-user/example-project/frontend/node_modules/inotify/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:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:375:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 4.19.0-16-amd64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/example-user/example-project/frontend/node_modules/inotify
gyp ERR! node -v v14.17.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/example-user/.npm/_logs/2021-06-16T21_38_31_135Z-debug.log

@markg85
Copy link

markg85 commented Aug 28, 2021

Same error here...
@c4milo could you please try to push a version that works?

Either that or just deprecate the whole project (in npmjs too).

@vwbusguy
Copy link

I'm also having this on node v16.11.1, npm 8.0.0, node-gyp v8.2.0.

This workaround worked for me:

Same errors using inotify-1.4.6, node v14.2.0, npm 6.14.5, node-gyp 6.1.0.

The pull request (repo: ashthespy/node-inotify) which should fix this failed with:

(...)
internal/modules/cjs/loader.js:1023
  throw err;
  ^

Error: Cannot find module 'nan'
Require stack:
- /mnt/.../node-inotify/[eval]
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1020:15)
    at Function.Module._load (internal/modules/cjs/loader.js:890:27)
    at Module.require (internal/modules/cjs/loader.js:1080:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at [eval]:1:1
    at Script.runInThisContext (vm.js:131:20)
    at Object.runInThisContext (vm.js:297:38)
    at Object.<anonymous> ([eval]-wrapper:10:26)
    at Module._compile (internal/modules/cjs/loader.js:1176:30)
    at evalScript (internal/process/execution.js:94:25) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/mnt/.../node-inotify/[eval]'
  ]
}
gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 5.6.11-arch1-1
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
(...)

So I had to run npm install nan in the node-inotify directory to resolve that problem. After node-gyp rebuild, the module is then loaded using: const Inotify = require('./node-inotify');.

In short, for Node v14 this should work:

git clone https://github.com/ashthespy/node-inotify.git
cd node-inotify
npm install nan
node-gyp rebuild
cd ..
node -e "const Inotify = require('./node-inotify').Inotify;console.log(Inotify);"

@vwbusguy
Copy link

It looks like the fix is simply to update bindings to 1.5.0. Simply updating that in the package.json and it now installs fine without needing to inject the rebuild.

@jcwatson11
Copy link

It looks like the fix is simply to update bindings to 1.5.0. Simply updating that in the package.json and it now installs fine without needing to inject the rebuild.

Sorry, what exactly does that mean? Can you tell me what file to edit, and how to edit it?

@artforlife
Copy link

artforlife commented Apr 29, 2022

I am getting a similar error when doing npm i -g gulp. The same thing happens when I run npm i -g https://github.com/c4milo/node-inotify.git . Not sure what is going on. Is this project even supported? Why does it break so many things?

P.S.

Ubuntu 22.04, 20.04
node = v16.14.2
npm = 8.6.0

@artforlife
Copy link

artforlife commented Apr 29, 2022

I was first getting this error when I was trying to install gulp globally via npm i -g gulp . Your advice below seems to have moved me past this error.

However, I am now getting the same error when I run yarn inside my project's directory. Any advice on what I can do here?

Ubuntu 22.04, 20.04
node = v16.14.2
npm = 8.6.0
node-gyp=9.0.0

I'm also having this on node v16.11.1, npm 8.0.0, node-gyp v8.2.0.

This workaround worked for me:

Same errors using inotify-1.4.6, node v14.2.0, npm 6.14.5, node-gyp 6.1.0.
The pull request (repo: ashthespy/node-inotify) which should fix this failed with:

(...)
internal/modules/cjs/loader.js:1023
  throw err;
  ^

Error: Cannot find module 'nan'
Require stack:
- /mnt/.../node-inotify/[eval]
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1020:15)
    at Function.Module._load (internal/modules/cjs/loader.js:890:27)
    at Module.require (internal/modules/cjs/loader.js:1080:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at [eval]:1:1
    at Script.runInThisContext (vm.js:131:20)
    at Object.runInThisContext (vm.js:297:38)
    at Object.<anonymous> ([eval]-wrapper:10:26)
    at Module._compile (internal/modules/cjs/loader.js:1176:30)
    at evalScript (internal/process/execution.js:94:25) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/mnt/.../node-inotify/[eval]'
  ]
}
gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 5.6.11-arch1-1
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
(...)

So I had to run npm install nan in the node-inotify directory to resolve that problem. After node-gyp rebuild, the module is then loaded using: const Inotify = require('./node-inotify');.
In short, for Node v14 this should work:

git clone https://github.com/ashthespy/node-inotify.git
cd node-inotify
npm install nan
node-gyp rebuild
cd ..
node -e "const Inotify = require('./node-inotify').Inotify;console.log(Inotify);"

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