Node-serialport: Serial port connect electron

Created on 2 Jul 2019  路  3Comments  路  Source: serialport/node-serialport

  • Trying to read pin with johnny-five.
  • Error :NODE_MODULE_VERSION 64. This version of Node.js requires NODE_MODULE_VERSION 70. Please try re-compiling or re-installing
  • I do not know work on an empty project

Versions, Operating System and Hardware

  • "serialport": "^7.1.5",
  • "electron": "^5.0.4",
  • Node.js v10.16.0
  • Mac Mojave 10.14.5

Code to Reproduce the Issue

let five = require('johnny-five');
var board = new five.Board();


(node:5746) UnhandledPromiseRejectionWarning: Error: The module '/Users/test/client/node_modules/@serialport/bindings/build/Release/bindings.node'
  was compiled against a different Node.js version using
  NODE_MODULE_VERSION 64. This version of Node.js requires
  NODE_MODULE_VERSION 70. Please try re-compiling or re-installing
  the module (for instance, using `npm rebuild` or `npm install`).
      at process.func [as dlopen] (electron/js2c/asar.js:155:31)
      at Object.Module._extensions..node (internal/modules/cjs/loader.js:857:18)
      at Object.func [as .node] (electron/js2c/asar.js:155:31)
      at Module.load (internal/modules/cjs/loader.js:677:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:609:12)
      at Function.Module._load (internal/modules/cjs/loader.js:601:3)
      at Module.require (internal/modules/cjs/loader.js:715:19)
      at require (internal/modules/cjs/helpers.js:14:16)
      at bindings (/Users/demo/Documents/Project/DD/db-client/node_modules/bindings/bindings.js:112:48)
      at Object.<anonymous> (/Users/demo/Documents/Project/DD/db-client/node_modules/@serialport/bindings/lib/darwin.js:1:36)
      at Module._compile (internal/modules/cjs/loader.js:815:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
      at Module.load (internal/modules/cjs/loader.js:677:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:609:12)
      at Function.Module._load (internal/modules/cjs/loader.js:601:3)
      at Module.require (internal/modules/cjs/loader.js:715:19)

// Code

My Test :

npm rebuild no problem

./node_modules/.bin/electron-rebuild it gives an error

```js
An unhandled error occurred inside electron-rebuild
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info spawn /usr/bin/python
gyp info spawn args [ '/Users/demo/Documents/Project/DD/db-client/node_modules/electron-rebuild/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/demo/Documents/Project/DD/db-client/node_modules/avrgirl-arduino/node_modules/serialport/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/demo/Documents/Project/DD/db-client/node_modules/electron-rebuild/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/demo/.electron-gyp/5.0.6/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/demo/.electron-gyp/5.0.6',
gyp info spawn args '-Dnode_gyp_dir=/Users/demo/Documents/Project/DD/db-client/node_modules/electron-rebuild/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/demo/.electron-gyp/5.0.6/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/demo/Documents/Project/DD/db-client/node_modules/avrgirl-arduino/node_modules/serialport',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CXX(target) Release/obj.target/serialport/src/serialport.o
../src/serialport.cpp:41:39: warning: 'ToString' is deprecated: Use maybe version [-Wdeprecated-declarations]
v8::String::Utf8Value path(info[0]->ToString());
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:2418:10: note: 'ToString' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local ToString() const);
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:307:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:41:25: warning: 'Utf8Value' is deprecated: Use Isolate version [-Wdeprecated-declarations]
v8::String::Utf8Value path(info[0]->ToString());
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:2893:5: note: 'Utf8Value' has been explicitly marked deprecated here
V8_DEPRECATED("Use Isolate version",
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:307:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:48:44: warning: 'ToObject' is deprecated: Use maybe version [-Wdeprecated-declarations]
v8::Local options = info[1]->ToObject();
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:2419:10: note: 'ToObject' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local ToObject() const);
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:307:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:95:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(2, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:113:44: warning: 'ToObject' is deprecated: Use maybe version [-Wdeprecated-declarations]
v8::Local options = info[1]->ToObject();
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:2419:10: note: 'ToObject' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local ToObject() const);
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:307:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:150:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(1, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:188:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(1, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:231:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(1, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:250:44: warning: 'ToObject' is deprecated: Use maybe version [-Wdeprecated-declarations]
v8::Local options = info[1]->ToObject();
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:2419:10: note: 'ToObject' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local ToObject() const);
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:307:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:285:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(1, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:329:14: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
results->Set(Nan::New("cts").ToLocalChecked(), Nan::New(data->cts));
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:3259:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version",
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:330:14: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
results->Set(Nan::New("dsr").ToLocalChecked(), Nan::New(data->dsr));
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:3259:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version",
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:331:14: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
results->Set(Nan::New("dcd").ToLocalChecked(), Nan::New(data->dcd));
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:3259:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version",
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:336:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(2, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:378:14: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
results->Set(Nan::New("baudRate").ToLocalChecked(), Nan::New(data->baudRate));
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:3259:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version",
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:383:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(2, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:424:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(1, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:460:8: error: variable has incomplete type 'void'
void init(v8::Handle target) {
^
../src/serialport.cpp:460:34: error: expected '(' for function-style cast or type construction
void init(v8::Handle target) {
~~^
../src/serialport.cpp:460:17: error: no member named 'Handle' in namespace 'v8'
void init(v8::Handle target) {
~~~~^
../src/serialport.cpp:460:36: error: use of undeclared identifier 'target'
void init(v8::Handle target) {
^
../src/serialport.cpp:460:43: error: expected ';' after top level declarator
void init(v8::Handle target) {
^
;
17 warnings and 5 errors generated.
make: * [Release/obj.target/serialport/src/serialport.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/demo/Documents/Project/DD/db-client/node_modules/electron-rebuild/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/bin/node" "/Users/demo/Documents/Project/DD/db-client/node_modules/electron-rebuild/node_modules/.bin/node-gyp" "rebuild" "--target=5.0.6" "--arch=x64" "--dist-url=https://electronjs.org/headers" "--build-from-source"
gyp ERR! cwd /Users/demo/Documents/Project/DD/db-client/node_modules/avrgirl-arduino/node_modules/serialport
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v4.0.0
gyp ERR! not ok

Failed with exit code: 1

Error: gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info spawn /usr/bin/python
gyp info spawn args [ '/Users/demo/Documents/Project/DD/db-client/node_modules/electron-rebuild/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/demo/Documents/Project/DD/db-client/node_modules/avrgirl-arduino/node_modules/serialport/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/demo/Documents/Project/DD/db-client/node_modules/electron-rebuild/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/demo/.electron-gyp/5.0.6/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/demo/.electron-gyp/5.0.6',
gyp info spawn args '-Dnode_gyp_dir=/Users/demo/Documents/Project/DD/db-client/node_modules/electron-rebuild/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/demo/.electron-gyp/5.0.6/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/demo/Documents/Project/DD/db-client/node_modules/avrgirl-arduino/node_modules/serialport',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CXX(target) Release/obj.target/serialport/src/serialport.o
../src/serialport.cpp:41:39: warning: 'ToString' is deprecated: Use maybe version [-Wdeprecated-declarations]
v8::String::Utf8Value path(info[0]->ToString());
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:2418:10: note: 'ToString' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local ToString() const);
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:307:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:41:25: warning: 'Utf8Value' is deprecated: Use Isolate version [-Wdeprecated-declarations]
v8::String::Utf8Value path(info[0]->ToString());
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:2893:5: note: 'Utf8Value' has been explicitly marked deprecated here
V8_DEPRECATED("Use Isolate version",
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:307:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:48:44: warning: 'ToObject' is deprecated: Use maybe version [-Wdeprecated-declarations]
v8::Local options = info[1]->ToObject();
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:2419:10: note: 'ToObject' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local ToObject() const);
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:307:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:95:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(2, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:113:44: warning: 'ToObject' is deprecated: Use maybe version [-Wdeprecated-declarations]
v8::Local options = info[1]->ToObject();
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:2419:10: note: 'ToObject' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local ToObject() const);
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:307:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:150:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(1, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:188:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(1, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:231:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(1, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:250:44: warning: 'ToObject' is deprecated: Use maybe version [-Wdeprecated-declarations]
v8::Local options = info[1]->ToObject();
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:2419:10: note: 'ToObject' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local ToObject() const);
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:307:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:285:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(1, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:329:14: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
results->Set(Nan::New("cts").ToLocalChecked(), Nan::New(data->cts));
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:3259:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version",
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:330:14: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
results->Set(Nan::New("dsr").ToLocalChecked(), Nan::New(data->dsr));
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:3259:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version",
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:331:14: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
results->Set(Nan::New("dcd").ToLocalChecked(), Nan::New(data->dcd));
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:3259:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version",
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:336:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(2, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:378:14: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
results->Set(Nan::New("baudRate").ToLocalChecked(), Nan::New(data->baudRate));
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8.h:3259:3: note: 'Set' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use maybe version",
^
/Users/demo/.electron-gyp/5.0.6/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
declarator __attribute__((deprecated(message)))
^
../src/serialport.cpp:383:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(2, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:424:18: warning: 'Call' is deprecated [-Wdeprecated-declarations]
data->callback.Call(1, argv);
^
../../../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local
^
../../../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED __attribute__((deprecated))

                                   ^

../src/serialport.cpp:460:8: error: variable has incomplete type 'void'
void init(v8::Handle target) {
^
../src/serialport.cpp:460:34: error: expected '(' for function-style cast or type construction
void init(v8::Handle target) {
~~^
../src/serialport.cpp:460:17: error: no member named 'Handle' in namespace 'v8'
void init(v8::Handle target) {
~~~~^
../src/serialport.cpp:460:36: error: use of undeclared identifier 'target'
void init(v8::Handle target) {
^
../src/serialport.cpp:460:43: error: expected ';' after top level declarator
void init(v8::Handle target) {
^
;
17 warnings and 5 errors generated.
make: * [Release/obj.target/serialport/src/serialport.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/demo/Documents/Project/DD/db-client/node_modules/electron-rebuild/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/bin/node" "/Users/demo/Documents/Project/DD/db-client/node_modules/electron-rebuild/node_modules/.bin/node-gyp" "rebuild" "--target=5.0.6" "--arch=x64" "--dist-url=https://electronjs.org/headers" "--build-from-source"
gyp ERR! cwd /Users/demo/Documents/Project/DD/db-client/node_modules/avrgirl-arduino/node_modules/serialport
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v4.0.0
gyp ERR! not ok

Failed with exit code: 1
at SafeSubscriber._error (/Users/demo/Documents/Project/DD/db-client/node_modules/spawn-rx/lib/src/index.js:267:84)
at SafeSubscriber.__tryOrUnsub (/Users/demo/Documents/Project/DD/db-client/node_modules/rxjs/internal/Subscriber.js:205:16)
at SafeSubscriber.error (/Users/demo/Documents/Project/DD/db-client/node_modules/rxjs/internal/Subscriber.js:156:26)
at Subscriber._error (/Users/demo/Documents/Project/DD/db-client/node_modules/rxjs/internal/Subscriber.js:92:26)
at Subscriber.error (/Users/demo/Documents/Project/DD/db-client/node_modules/rxjs/internal/Subscriber.js:72:18)
at MapSubscriber.Subscriber._error (/Users/demo/Documents/Project/DD/db-client/node_modules/rxjs/internal/Subscriber.js:92:26)
at MapSubscriber.Subscriber.error (/Users/demo/Documents/Project/DD/db-client/node_modules/rxjs/internal/Subscriber.js:72:18)
at SafeSubscriber._next (/Users/demo/Documents/Project/DD/db-client/node_modules/spawn-rx/lib/src/index.js:242:65)
at SafeSubscriber.__tryOrUnsub (/Users/demo/Documents/Project/DD/db-client/node_modules/rxjs/internal/Subscriber.js:205:16)
at SafeSubscriber.next (/Users/demo/Docume

stale-issue

Most helpful comment

It's troublesome. but I can recommend this to you

Create the binding.gyp file for the project. and add the following content

```{
"targets": [
{
"target_name": "binding",
'sources' : [ " }
]
}

node-gyp configure Check the correctness of your configuration.

**run terminal :** open  /Users/demo/.electron-gyp/5.0.6/include/node/v8.h
and fix 

**Current File**

protected:
V8_INLINE HandleScope() {}

void Initialize(Isolate* isolate);

static internal::Object* CreateHandle(internal::Isolate isolate,
internal::Object* value);`

**Must Be**

public:
V8_INLINE HandleScope() {}

void Initialize(Isolate* isolate);

static internal::Object* CreateHandle(internal::Isolate isolate,
internal::Object* value);
```

In short you need to translate the protected part to public
and run agin ./node_modules/.bin/electron-rebuild

All 3 comments

It's troublesome. but I can recommend this to you

Create the binding.gyp file for the project. and add the following content

```{
"targets": [
{
"target_name": "binding",
'sources' : [ " }
]
}

node-gyp configure Check the correctness of your configuration.

**run terminal :** open  /Users/demo/.electron-gyp/5.0.6/include/node/v8.h
and fix 

**Current File**

protected:
V8_INLINE HandleScope() {}

void Initialize(Isolate* isolate);

static internal::Object* CreateHandle(internal::Isolate isolate,
internal::Object* value);`

**Must Be**

public:
V8_INLINE HandleScope() {}

void Initialize(Isolate* isolate);

static internal::Object* CreateHandle(internal::Isolate isolate,
internal::Object* value);
```

In short you need to translate the protected part to public
and run agin ./node_modules/.bin/electron-rebuild

It's troublesome. but I can recommend this to you

Create the binding.gyp file for the project. and add the following content

  "targets": [
    {
      "target_name": "binding",
       'sources' : [  "<!@(node -p \"require('fs').readdirSync('./src').map(f=>'src/'+f).join(' ')\")" ],
    }
  ]
}

node-gyp configure Check the correctness of your configuration.

run terminal : open /Users/demo/.electron-gyp/5.0.6/include/node/v8.h
and fix

Current File

protected:
  V8_INLINE HandleScope() {}

  void Initialize(Isolate* isolate);

  static internal::Object** CreateHandle(internal::Isolate* isolate,
                                         internal::Object* value);`

Must Be

public:
  V8_INLINE HandleScope() {}

  void Initialize(Isolate* isolate);

  static internal::Object** CreateHandle(internal::Isolate* isolate,
                                         internal::Object* value);

In short you need to translate the protected part to public
and run agin ./node_modules/.bin/electron-rebuild

this worked well for me, many thanks.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week no further activity occurs. Feel free continue the discussion or ask for a never-stale label to keep it open. If this is a support issue, consider sharing it on stack overflow to get more eyes on your problem.

Was this page helpful?
0 / 5 - 0 ratings