npm错误:gyp错误 npm ERR!inotify@1.4.6安装:`node-gyp rebuild`

4

在执行npm -i env-cmd --save dev命令时,我遇到了以下错误:

我想添加env-cmd节点模块,并使用npm将其保存为devDependency,但每次运行上述命令时都会遇到以下错误:

inotify@1.4.6安装/home/dev/Documents/task_manager_app/node_modules/inotify > node-gyp重建

make: Entering directory '/home/dev/Documents/task_manager_app/node_modules/inotify/build'
  CXX(target) Release/obj.target/inotify/src/bindings.o
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]
 2294 |     , 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
   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/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:2532:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
 2532 |   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
      |                                            ^~~~~~~~
/home/dev/.node-gyp/12.0.0/include/node/v8.h:2532:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/dev/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/dev/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:2546:35: note: candidate: ‘v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const’
 2546 |                     Local<Object> ToObject(Isolate* isolate) const);
      |                                   ^~~~~~~~
/home/dev/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
  322 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
/home/dev/.node-gyp/12.0.0/include/node/v8.h:2546:35: note:   candidate expects 1 argument, 0 provided
 2546 |                     Local<Object> ToObject(Isolate* isolate) const);
      |                                   ^~~~~~~~
/home/dev/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
  322 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../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/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3449:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)’
 3449 |   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
      |                                     ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3449:37: note:   candidate expects 2 arguments, 1 provided
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3455:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, uint32_t)’
 3455 |   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
      |                                     ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3455: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/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3449:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)’
 3449 |   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
      |                                     ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3449:37: note:   candidate expects 2 arguments, 1 provided
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3455:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, uint32_t)’
 3455 |   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
      |                                     ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3455:37: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:155:28: warning: ‘v8::Local<v8::Value> v8::Object::Get(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  155 |    !args_->Get(callback_sym)->IsFunction()) {
      |                            ^
In file included from /home/dev/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/dev/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3412:55: note: declared here
 3412 |   V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
      |                                                       ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
  322 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../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/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3449:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)’
 3449 |   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
      |                                     ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3449:37: note:   candidate expects 2 arguments, 1 provided
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3455:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Has(v8::Local<v8::Context>, uint32_t)’
 3455 |   V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
      |                                     ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3455:37: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:163:33: warning: ‘v8::Local<v8::Value> v8::Object::Get(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  163 |    if (!args_->Get(watch_for_sym)->IsInt32()) {
      |                                 ^
In file included from /home/dev/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/dev/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3412:55: note: declared here
 3412 |   V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
      |                                                       ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
  322 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../src/bindings.cc:166:36: warning: ‘v8::Local<v8::Value> v8::Object::Get(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  166 |    mask |= args_->Get(watch_for_sym)->Int32Value();
      |                                    ^
In file included from /home/dev/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/dev/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3412:55: note: declared here
 3412 |   V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
      |                                                       ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
  322 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../src/bindings.cc:166:50: error: no matching function for call to ‘v8::Value::Int32Value()’
  166 |    mask |= args_->Get(watch_for_sym)->Int32Value();
      |                                                  ^
In file included from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:2569:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
 2569 |   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
      |                                        ^~~~~~~~~~
/home/dev/.node-gyp/12.0.0/include/node/v8.h:2569:40: note:   candidate expects 1 argument, 0 provided
../src/bindings.cc:172:45: warning: ‘v8::Local<v8::Value> v8::Object::Get(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  172 |   String::Utf8Value path(args_->Get(path_sym));
      |                                             ^
In file included from /home/dev/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/dev/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3412:55: note: declared here
 3412 |   V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
      |                                                       ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
  322 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../src/bindings.cc:172:46: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’
  172 |   String::Utf8Value path(args_->Get(path_sym));
      |                                              ^
In file included from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:2995:5: note: candidate: ‘v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)’
 2995 |     Utf8Value(Isolate* isolate, Local<v8::Value> obj);
      |     ^~~~~~~~~
/home/dev/.node-gyp/12.0.0/include/node/v8.h:2995:5: note:   candidate expects 2 arguments, 1 provided
../src/bindings.cc:182:61: warning: ‘v8::Local<v8::Value> v8::Object::Get(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  182 |   inotify->handle()->Set(descriptor, args_->Get(callback_sym));
      |                                                             ^
In file included from /home/dev/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/dev/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3412:55: note: declared here
 3412 |   V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
      |                                                       ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
  322 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../src/bindings.cc:182:62: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  182 |   inotify->handle()->Set(descriptor, args_->Get(callback_sym));
      |                                                              ^
In file included from /home/dev/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/dev/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3359:26: note: declared here
 3359 |                     bool Set(Local<Value> key, Local<Value> value));
      |                          ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
  322 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../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/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:2569:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
 2569 |   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
      |                                        ^~~~~~~~~~
/home/dev/.node-gyp/12.0.0/include/node/v8.h:2569: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: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  262 |     obj->Set(Nan::New<String>("watch").ToLocalChecked(), Nan::New<Integer>(event->wd));
      |                                                                                      ^
In file included from /home/dev/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/dev/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3359:26: note: declared here
 3359 |                     bool Set(Local<Value> key, Local<Value> value));
      |                          ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
  322 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../src/bindings.cc:263:87: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  263 |     obj->Set(Nan::New<String>("mask").ToLocalChecked(), Nan::New<Integer>(event->mask));
      |                                                                                       ^
In file included from /home/dev/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/dev/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3359:26: note: declared here
 3359 |                     bool Set(Local<Value> key, Local<Value> value));
      |                          ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
  322 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../src/bindings.cc:264:91: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  264 |     obj->Set(Nan::New<String>("cookie").ToLocalChecked(), Nan::New<Integer>(event->cookie));
      |                                                                                           ^
In file included from /home/dev/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/dev/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3359:26: note: declared here
 3359 |                     bool Set(Local<Value> key, Local<Value> value));
      |                          ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
  322 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../src/bindings.cc:267:104: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  267 |      obj->Set(Nan::New<String>("name").ToLocalChecked(), Nan::New<String>(event->name).ToLocalChecked());
      |                                                                                                        ^
In file included from /home/dev/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/dev/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3359:26: note: declared here
 3359 |                     bool Set(Local<Value> key, Local<Value> value));
      |                          ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
  322 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../src/bindings.cc:275:66: warning: ‘v8::Local<v8::Value> v8::Object::Get(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  275 |     Local<Value> value = handle->Get(Nan::New<Integer>(event->wd));
      |                                                                  ^
In file included from /home/dev/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/dev/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:3412:55: note: declared here
 3412 |   V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
      |                                                       ^~~
/home/dev/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
  322 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../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:
../../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/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:2528:44: note: candidate: ‘v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const’
 2528 |   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
      |                                            ^~~~~~~~
/home/dev/.node-gyp/12.0.0/include/node/v8.h:2528:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/dev/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/dev/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.0/include/node/v8.h:2544:35: note: candidate: ‘v8::Local<v8::String> v8::Value::ToString(v8::Isolate*) const’
 2544 |                     Local<String> ToString(Isolate* isolate) const);
      |                                   ^~~~~~~~
/home/dev/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
  322 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
/home/dev/.node-gyp/12.0.0/include/node/v8.h:2544:35: note:   candidate expects 1 argument, 0 provided
 2544 |                     Local<String> ToString(Isolate* isolate) const);
      |                                   ^~~~~~~~
/home/dev/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
  322 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
In file included from /home/dev/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../src/node_inotify.h:5,
                 from ../src/bindings.h:4,
                 from ../src/bindings.cc:2:
/home/dev/.node-gyp/12.0.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/dev/.node-gyp/12.0.0/include/node/node_object_wrap.h:84:78:   required from here
/home/dev/.node-gyp/12.0.0/include/node/v8.h:9817: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]
 9817 |                reinterpret_cast<Callback>(callback), type);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dev/.node-gyp/12.0.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/dev/.node-gyp/12.0.0/include/node/v8.h:9817: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:108: Release/obj.target/inotify/src/bindings.o] Error 1
make: Leaving directory '/home/dev/Documents/task_manager_app/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/dev/.nvm/versions/node/v12.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Linux 5.3.0-18-generic
gyp ERR! command "/home/dev/.nvm/versions/node/v12.0.0/bin/node" "/home/dev/.nvm/versions/node/v12.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/dev/Documents/task_manager_app/node_modules/inotify
gyp ERR! node -v v12.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN task_manager_app@1.0.0 No description
npm WARN task_manager_app@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! inotify@1.4.6 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the inotify@1.4.6 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/dev/.npm/_logs/2020-09-23T05_08_06_886Z-debug.log
1个回答

5
我没有使用 "--save-dev",而是使用了 "--save dev",所以出现了这个错误。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接