kan-qi / UMLx

Analyze software architecture and generate insights about software development complexities, risks, and costs.
3 stars 0 forks source link

Error while installing node module "webworker-threads" for macOS #636

Closed CitruXonve closed 5 years ago

CitruXonve commented 5 years ago
> webworker-threads@0.4.13 install /usr/local/lib/node_modules/webworker-threads
> node-gyp rebuild

  CXX(target) Release/obj.target/WebWorkerThreads/src/WebWorkerThreads.o
In file included from ../src/WebWorkerThreads.cc:12:
../node_modules/nan/nan.h:190:32: warning: 'BooleanValue' is deprecated: Use maybe version [-Wdeprecated-declarations]
      || optionsObj->Get(opt)->BooleanValue();
                               ^
/Users/crxon/Library/Caches/node-gyp/11.14.0/include/node/v8.h:2568:3: note: 'BooleanValue' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", bool BooleanValue() const);
  ^
/Users/crxon/Library/Caches/node-gyp/11.14.0/include/node/v8config.h:326:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/WebWorkerThreads.cc:12:
../node_modules/nan/nan.h:194:32: warning: 'BooleanValue' is deprecated: Use maybe version [-Wdeprecated-declarations]
      && optionsObj->Get(opt)->BooleanValue();
                               ^
/Users/crxon/Library/Caches/node-gyp/11.14.0/include/node/v8.h:2568:3: note: 'BooleanValue' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", bool BooleanValue() const);
  ^
/Users/crxon/Library/Caches/node-gyp/11.14.0/include/node/v8config.h:326:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/WebWorkerThreads.cc:12:
../node_modules/nan/nan.h:213:31: warning: 'Uint32Value' is deprecated: Use maybe version [-Wdeprecated-declarations]
      ? optionsObj->Get(opt)->Uint32Value()
                              ^
/Users/crxon/Library/Caches/node-gyp/11.14.0/include/node/v8.h:2571:3: note: 'Uint32Value' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", uint32_t Uint32Value() const);
  ^
/Users/crxon/Library/Caches/node-gyp/11.14.0/include/node/v8config.h:326:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/WebWorkerThreads.cc:12:
../node_modules/nan/nan.h:339:13: error: no member named 'New' in 'v8::String'
    return  _NAN_ERROR(v8::Exception::Error, errmsg);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:343:5: error: no member named 'ThrowException' in namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::Error, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../node_modules/nan/nan.h:343:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::Error, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
                         ^~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:348:9: error: no type named 'ThrowException' in namespace 'v8'
    v8::ThrowException(error);
    ~~~~^
../node_modules/nan/nan.h:355:65: error: no member named 'New' in 'v8::String'
    v8::Local<v8::Value> err = v8::Exception::Error(v8::String::New(msg));
                                                    ~~~~~~~~~~~~^
../node_modules/nan/nan.h:356:50: error: expected '(' for function-style cast or type construction
    v8::Local<v8::Object> obj = err.As<v8::Object>();
                                       ~~~~~~~~~~^
../node_modules/nan/nan.h:356:52: error: expected expression
    v8::Local<v8::Object> obj = err.As<v8::Object>();
                                                   ^
../node_modules/nan/nan.h:357:65: error: too few arguments to function call, expected 2, have 1
    obj->Set(v8::String::New("code"), v8::Int32::New(errorNumber));
                                      ~~~~~~~~~~~~~~            ^
/Users/crxon/Library/Caches/node-gyp/11.14.0/include/node/v8.h:3154:3: note: 'New' declared here
  static Local<Integer> New(Isolate* isolate, int32_t value);
  ^
In file included from ../src/WebWorkerThreads.cc:12:
../node_modules/nan/nan.h:357:26: error: no member named 'New' in 'v8::String'
    obj->Set(v8::String::New("code"), v8::Int32::New(errorNumber));
             ~~~~~~~~~~~~^
../node_modules/nan/nan.h:369:12: error: no member named 'New' in 'v8::String'
    return _NAN_ERROR(v8::Exception::TypeError, errmsg);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:373:5: error: no member named 'ThrowException' in namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../node_modules/nan/nan.h:373:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
                         ^~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:377:12: error: no member named 'New' in 'v8::String'
    return _NAN_ERROR(v8::Exception::RangeError, errmsg);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:381:5: error: no member named 'ThrowException' in namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../node_modules/nan/nan.h:381:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
                         ^~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:406:13: error: no member named 'smalloc' in namespace 'node'
    , node::smalloc::FreeCallback callback
      ~~~~~~^
../node_modules/nan/nan.h:141:71: note: expanded from macro 'NAN_INLINE'
# define NAN_INLINE(declarator) inline __attribute__((always_inline)) declarator
                                                                      ^~~~~~~~~~
../node_modules/nan/nan.h:416:12: error: no matching function for call to 'New'
    return node::Buffer::New(data, size);
           ^~~~~~~~~~~~~~~~~
/Users/crxon/Library/Caches/node-gyp/11.14.0/include/node/node_buffer.h:49:40: note: candidate function not viable: no known conversion from 'char *' to 'v8::Isolate *' for 1st argument
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_t length);
                                       ^
/Users/crxon/Library/Caches/node-gyp/11.14.0/include/node/node_buffer.h:52:40: note: candidate function not viable: no known conversion from 'char *' to 'v8::Isolate *' for 1st argument
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/crxon/Library/Caches/node-gyp/11.14.0/include/node/node_buffer.h:64:40: note: candidate function not viable: requires 3 arguments, but 2 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/crxon/Library/Caches/node-gyp/11.14.0/include/node/node_buffer.h:57:40: note: candidate function not viable: requires 5 arguments, but 2 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
In file included from ../src/WebWorkerThreads.cc:12:
../node_modules/nan/nan.h:420:12: error: no matching function for call to 'New'
    return node::Buffer::New(size);
           ^~~~~~~~~~~~~~~~~
/Users/crxon/Library/Caches/node-gyp/11.14.0/include/node/node_buffer.h:49:40: note: candidate function not viable: requires 2 arguments, but 1 was provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_t length);
                                       ^
/Users/crxon/Library/Caches/node-gyp/11.14.0/include/node/node_buffer.h:52:40: note: candidate function not viable: requires at least 2 arguments, but 1 was provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/crxon/Library/Caches/node-gyp/11.14.0/include/node/node_buffer.h:64:40: note: candidate function not viable: requires 3 arguments, but 1 was provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/crxon/Library/Caches/node-gyp/11.14.0/include/node/node_buffer.h:57:40: note: candidate function not viable: requires 5 arguments, but 1 was provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
In file included from ../src/WebWorkerThreads.cc:12:
../node_modules/nan/nan.h:427:26: error: no member named 'Use' in namespace 'node::Buffer'
    return node::Buffer::Use(data, size);
           ~~~~~~~~~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
3 warnings and 20 errors generated.
make: *** [Release/obj.target/WebWorkerThreads/src/WebWorkerThreads.o] Error 1
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:196:23)
gyp ERR! stack     at ChildProcess.emit (events.js:193:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:255:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/Cellar/node/11.14.0_1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/webworker-threads
gyp ERR! node -v v11.14.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webworker-threads@0.4.13 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webworker-threads@0.4.13 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!     /Users/crxon/.npm/_logs/2019-09-11T22_10_57_385Z-debug.log
> node -v                                                                                                                                                                            
v11.14.0
> npm --version                                                                                                                                                                          
6.11.3
> node-gyp -v                                                                                                                                                                            
v5.0.3
CitruXonve commented 5 years ago

This might be caused by using the latest version of node. Use nvm to switch to node v8 and the demo works well.