2

我正在尝试让串行端口与电子一起工作。Serialport 是原生模块,所以我了解到您必须重新编译它才能使用电子。我已经完成了这里其他几个线程所说的步骤,当我运行 npm install 时,我收到了这个疯狂的长错误消息

> FOD-GUI@1.0.0 install C:\FOD\FOD-JS
> electron-rebuild

× Rebuild Failed

An unhandled error occurred inside electron-rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  serialport.cpp
  serialport_win.cpp
  win_delay_load_hook.cc
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(51): error C2146: syntax error : missing ';' before identifier 'intptr_t' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(51): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(52): error C2146: syntax error : missing ';' before identifier 'uintptr_t' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(52): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(52): error C2086: 'int v8::internal::constexpr' : redefinition (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(51) : see declaration of 'v8::internal::constexpr'
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(60): error C2146: syntax error : missing ';' before identifier 'intptr_t' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(60): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(62): error C2146: syntax error : missing ';' before identifier 'intptr_t' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(62): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(62): error C2086: 'int v8::internal::SmiTagging<0x04>::constexpr' : redefinition (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(60) : see declaration of 'v8::internal::SmiTagging<0x04>::constexpr'
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(69): error C2144: syntax error : 'bool' should be preceded by ';' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(69): error C2433: 'v8::internal::SmiTagging<0x04>::constexpr' : '__forceinline' not permitted on data declarations (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(69): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(69): error C2086: 'int v8::internal::SmiTagging<0x04>::constexpr' : redefinition (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(60) : see declaration of 'v8::internal::SmiTagging<0x04>::constexpr'
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(85): error C2146: syntax error : missing ';' before identifier 'intptr_t' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(85): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(87): error C2146: syntax error : missing ';' before identifier 'intptr_t' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(87): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(87): error C2086: 'int v8::internal::SmiTagging<0x08>::constexpr' : redefinition (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(85) : see declaration of 'v8::internal::SmiTagging<0x08>::constexpr'
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(94): error C2144: syntax error : 'bool' should be preceded by ';' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(94): error C2433: 'v8::internal::SmiTagging<0x08>::constexpr' : '__forceinline' not permitted on data declarations (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(94): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(94): error C2086: 'int v8::internal::SmiTagging<0x08>::constexpr' : redefinition (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(85) : see declaration of 'v8::internal::SmiTagging<0x08>::constexpr'
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(117): error C2440: 'static_cast' : cannot convert from 'unknown' to 'int' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          There is no context in which this conversion is possible
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(118): error C2440: 'static_cast' : cannot convert from 'unknown' to 'int' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          There is no context in which this conversion is possible
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(119): error C2144: syntax error : 'bool' should be preceded by ';' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(119): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(119): error C2086: 'int v8::internal::constexpr' : redefinition (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(51) : see declaration of 'v8::internal::constexpr'
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(120): error C2144: syntax error : 'bool' should be preceded by ';' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(120): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(120): error C2086: 'int v8::internal::constexpr' : redefinition (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(51) : see declaration of 'v8::internal::constexpr'
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(122): error C2143: syntax error : missing ';' before 'v8::internal::Address' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(122): error C2433: 'constexpr' : '__forceinline' not permitted on data declarations (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(122): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(122): error C2370: 'v8::internal::constexpr' : redefinition; different storage class (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(51) : see declaration of 'v8::internal::constexpr'
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(196): error C2144: syntax error : 'int' should be preceded by ';' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(196): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(213): error C2143: syntax error : missing ';' before 'v8::internal::Address' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(213): error C2433: 'v8::internal::Internals::constexpr' : '__forceinline' not permitted on data declarations (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(213): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(213): error C2086: 'int v8::internal::Internals::constexpr' : redefinition (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(196) : see declaration of 'v8::internal::Internals::constexpr'
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(217): error C2144: syntax error : 'bool' should be preceded by ';' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(217): error C2433: 'v8::internal::Internals::constexpr' : '__forceinline' not permitted on data declarations (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(217): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(217): error C2086: 'int v8::internal::Internals::constexpr' : redefinition (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(196) : see declaration of 'v8::internal::Internals::constexpr'
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(218): error C2352: 'v8::internal::SmiTagging<0x08>::IsValidSmi' : illegal call of non-static member function (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(94) : see declaration of 'v8::internal::SmiTagging<0x08>::IsValidSmi'
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8.h(2637): error C2144: syntax error : 'int' should be preceded by ';' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8.h(2637): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(51): error C2146: syntax error : missing ';' before identifier 'intptr_t' (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(51): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(52): error C2146: syntax error : missing ';' before identifier 'uintptr_t' (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(52): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(52): error C2086: 'int v8::internal::constexpr' : redefinition (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(51) : see declaration of 'v8::internal::constexpr'
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(60): error C2146: syntax error : missing ';' before identifier 'intptr_t' (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(60): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(62): error C2146: syntax error : missing ';' before identifier 'intptr_t' (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(62): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(62): error C2086: 'int v8::internal::SmiTagging<0x04>::constexpr' : redefinition (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(60) : see declaration of 'v8::internal::SmiTagging<0x04>::constexpr'
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8.h(4380): error C2146: syntax error : missing ';' before identifier 'MemorySpan' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8.h(4392) : see reference to class template instantiation 'v8::MemorySpan<T>' being compiled
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8.h(4380): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(69): error C2144: syntax error : 'bool' should be preceded by ';' (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8.h(4382): error C2146: syntax error : missing ';' before identifier 'MemorySpan' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(69): error C2433: 'v8::internal::SmiTagging<0x04>::constexpr' : '__forceinline' not permitted on data declarations (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8.h(4382): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(69): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8.h(4385): error C2146: syntax error : missing ';' before identifier 'T' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(69): error C2086: 'int v8::internal::SmiTagging<0x04>::constexpr' : redefinition (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(60) : see declaration of 'v8::internal::SmiTagging<0x04>::constexpr'
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8.h(4385): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8.h(4387): error C2146: syntax error : missing ';' before identifier 'size_t' (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(85): error C2146: syntax error : missing ';' before identifier 'intptr_t' (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8.h(4387): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(85): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(87): error C2146: syntax error : missing ';' before identifier 'intptr_t' (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(87): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(87): error C2086: 'int v8::internal::SmiTagging<0x08>::constexpr' : redefinition (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
          c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(85) : see declaration of 'v8::internal::SmiTagging<0x08>::constexpr'
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8.h(4438): error C2610: 'v8::WasmModuleObject::TransferrableModule::TransferrableModule(v8::WasmModuleObject::TransferrableModule &&)' : is not a special member function which can be defaulted (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8.h(4441): error C2610: 'v8::WasmModuleObject::TransferrableModule &v8::WasmModuleObject::TransferrableModule::operator =(v8::WasmModuleObject::TransferrableModule &&)' : is not a special member function which can be defaulted (..\src\serialport.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(94): error C2144: syntax error : 'bool' should be preceded by ';' (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(94): error C2433: 'v8::internal::SmiTagging<0x08>::constexpr' : '__forceinline' not permitted on data declarations (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(94): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\serialport_win.cpp) [C:\FOD\FOD-JS\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\fodfindersingapore\.electron-gyp\6.0.10\include\node\v8-internal.h(94): error C2086: 'int v8::internal::SmiTagging<0x08>::constexpr' : redefinition (..\src\serialport_win.cpp) [C:\FOD\FOD-

该消息持续了大约四倍的长度......

我的 package.json 看起来像这样:

{
  "name": "FOD-GUI",
  "version": "1.0.0",
  "description": " ",
  "main": "main.js",
  "scripts": {
    "start": "electron .",
    "install": "electron-rebuild"
  },
  "author": "",
  "license": "CC0-1.0",
  "devDependencies": {
    "electron": "^6.0.10",
    "electron-rebuild": "^1.8.6"
  },
  "dependencies": {
    "@mapbox/mapbox-gl-draw": "^1.1.2",
    "@mapbox/mapbox-gl-draw-static-mode": "^1.0.1",
    "electron-settings": "^3.2.0",
    "express": "^4.17.1",
    "serialport": "^7.1.5",
    "socket.io": "^2.3.0"
  }
}

我不知道我做错了什么导致如此疯狂的错误,我使用的是最新版本的一切(节点、套接字和电子重建)

编辑:IDK,如果这有帮助,但是当我尝试运行它时遇到同样的错误:https ://github.com/serialport/electron-serialport项目。

编辑 2:已解决:我必须安装 MSVS 2017 构建工具才能让 nodegyp 工作。

4

0 回答 0