node-webworker icon indicating copy to clipboard operation
node-webworker copied to clipboard

安装报错

Open huangbinjie opened this issue 6 years ago • 1 comments

huangbinjie@~/workspace/yoi: (master) 🇨🇳 $ npm i webworker-ng

> [email protected] install /Users/huangbinjie/workspace/yoi/node_modules/webworker-ng
> node-gyp rebuild

  CXX(target) Release/obj.target/webworker/src/WebWorkerWrap.o
In file included from ../src/WebWorkerWrap.cc:1:
In file included from .././src/WebWorkerWrap.h:6:
In file included from ../node_modules/nan/nan.h:192:
../node_modules/nan/nan_maybe_43_inl.h:112:15: error: no member named 'ForceSet'
      in 'v8::Object'
  return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
         ~~~  ^
In file included from ../src/WebWorkerWrap.cc:1:
In file included from .././src/WebWorkerWrap.h:6:
../node_modules/nan/nan.h:834:18: warning: 'MakeCallback' is deprecated: Use
      MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/node.h:171:1: note: 
      'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded
      from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../src/WebWorkerWrap.cc:1:
In file included from .././src/WebWorkerWrap.h:6:
../node_modules/nan/nan.h:849:18: warning: 'MakeCallback' is deprecated: Use
      MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/node.h:164:1: note: 
      'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded
      from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../src/WebWorkerWrap.cc:1:
In file included from .././src/WebWorkerWrap.h:6:
../node_modules/nan/nan.h:864:18: warning: 'MakeCallback' is deprecated: Use
      MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/node.h:157:1: note: 
      'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded
      from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../src/WebWorkerWrap.cc:1:
In file included from .././src/WebWorkerWrap.h:6:
../node_modules/nan/nan.h:1473:31: warning: 'MakeCallback' is deprecated: Use
      MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return scope.Escape(node::MakeCallback(
                              ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/node.h:171:1: note: 
      'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded
      from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
../src/WebWorkerWrap.cc:21:26: warning: 'Utf8Value' is deprecated
      [-Wdeprecated-declarations]
    char* text = strdup(*String::Utf8Value(info[0]));
                         ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8.h:2821:5: note: 'Utf8Value'
      has been explicitly marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8config.h:321:29: note: 
      expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/WebWorkerWrap.cc:33:30: warning: 'Utf8Value' is deprecated
      [-Wdeprecated-declarations]
    char* pathname = strdup(*String::Utf8Value(info[0]));
                             ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8.h:2821:5: note: 'Utf8Value'
      has been explicitly marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8config.h:321:29: note: 
      expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/WebWorkerWrap.cc:62:36: warning: 'Utf8Value' is deprecated
      [-Wdeprecated-declarations]
    worker->request_name = strdup(*String::Utf8Value(info[0]));
                                   ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8.h:2821:5: note: 'Utf8Value'
      has been explicitly marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8config.h:321:29: note: 
      expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/WebWorkerWrap.cc:63:36: warning: 'Utf8Value' is deprecated
      [-Wdeprecated-declarations]
    worker->request_args = strdup(*String::Utf8Value(serializedParams.To...
                                   ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8.h:2821:5: note: 'Utf8Value'
      has been explicitly marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8config.h:321:29: note: 
      expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/WebWorkerWrap.cc:97:24: warning: 'Utf8Value' is deprecated
      [-Wdeprecated-declarations]
    char* id = strdup(*String::Utf8Value(info[0]));
                       ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8.h:2821:5: note: 'Utf8Value'
      has been explicitly marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8config.h:321:29: note: 
      expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/WebWorkerWrap.cc:118:50: warning: 'Run' is deprecated
      [-Wdeprecated-declarations]
  Local<Value> result = script.ToLocalChecked()->Run();
                                                 ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8.h:1250:3: note: 'Run' has
      been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", Local<Value> Run());
  ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8config.h:321:29: note: 
      expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/WebWorkerWrap.cc:141:58: warning: 'StackTrace' is deprecated
      [-Wdeprecated-declarations]
    Local<String> stack = Local<String>::Cast(try_catch->StackTrace());
                                                         ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8.h:8328:3: note: 
      'StackTrace' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version.", Local<Value> StackTrace() const);
  ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8config.h:321:29: note: 
      expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/WebWorkerWrap.cc:142:30: warning: 'Utf8Value' is deprecated
      [-Wdeprecated-declarations]
    fprintf(stderr, "%s\n", *String::Utf8Value(stack));
                             ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8.h:2821:5: note: 'Utf8Value'
      has been explicitly marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8config.h:321:29: note: 
      expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/WebWorkerWrap.cc:358:33: warning: 'Utf8Value' is deprecated
      [-Wdeprecated-declarations]
  worker->callback_id = strdup(*String::Utf8Value(info[0]));
                                ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8.h:2821:5: note: 'Utf8Value'
      has been explicitly marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/huangbinjie/.node-gyp/10.0.0/include/node/v8config.h:321:29: note: 
      expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
13 warnings and 1 error generated.
make: *** [Release/obj.target/webworker/src/WebWorkerWrap.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:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/Cellar/node/10.0.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/huangbinjie/workspace/yoi/node_modules/webworker-ng
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN [email protected] No repository 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!     /Users/huangbinjie/.npm/_logs/2018-05-03T11_42_28_718Z-debug.log

顺便问一句,共享数据方便传送到 worker 吗?

huangbinjie avatar May 03 '18 11:05 huangbinjie

@huangbinjie 估计是因为 Node.js 版本问题,能回退到 9.x.x 试试吗?

顺便问一句,共享数据方便传送到 worker 吗?

跟 WebWorker 一样,.send() 就可以了~

yorkie avatar May 05 '18 06:05 yorkie