node-serialport: electron-rebuild failed with syntax errors
Summary of Problem
Running electron-rebuild for serialport module failed. And lots of syntax errors appears in the error message.
Code to Reproduce the Issue
$ yarn electron-rebuild
yarn run v1.22.4
$ node -r ../internals/scripts/BabelRegister.js ../internals/scripts/ElectronRebuild.js
× Rebuild Failed
An unhandled error occurred inside electron-rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@12.18.4 | win32 | x64
gyp info find Python using Python version 2.7.17 found at "C:\Python27\python.exe"
gyp info find VS using VS2015 (14.0) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio 14.0"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Python27\python.exe
gyp info spawn args [
gyp info spawn args 'D:\\Projects\\Desktop-projects\\Electron-Boilerplates\\electron-boilplate-v140\\node_modul
es\\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 'msvs',
gyp info spawn args '-I',
gyp info spawn args 'D:\\Projects\\Desktop-projects\\Electron-Boilerplates\\electron-boilplate-v140\\app\\node_
modules\\@serialport\\bindings\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'D:\\Projects\\Desktop-projects\\Electron-Boilerplates\\electron-boilplate-v140\\node_modul
es\\electron-rebuild\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\chengcheng\\.electron-gyp\\11.0.3\\include\\node\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\Users\\chengcheng\\.electron-gyp\\11.0.3',
gyp info spawn args '-Dnode_gyp_dir=D:\\Projects\\Desktop-projects\\Electron-Boilerplates\\electron-boilplate-v
140\\node_modules\\electron-rebuild\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\chengcheng\\\\.electron-gyp\\\\11.0.3\\\\<(target_arch)\\\\
node.lib',
gyp info spawn args '-Dmodule_root_dir=D:\\Projects\\Desktop-projects\\Electron-Boilerplates\\electron-boilplat
e-v140\\app\\node_modules\\@serialport\\bindings',
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 'D:\\Projects\\Desktop-projects\\Electron-Boilerplates\\electron-boilplate-v140\\app\\node_
modules\\@serialport\\bindings\\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]
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\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(17): error C2144: syntax error: 'int' should
be preceded by '}' (compiling source file ..\src\serialport_win.cpp) [D:\Projects\Desktop-projects\Electron-Boil
erplates\electron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(17): error C2144: syntax error: 'int' should
be preceded by '}' (compiling source file ..\src\serialport.cpp) [D:\Projects\Desktop-projects\Electron-Boilerpl
ates\electron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(17): error C2144: syntax error: 'int' should
be preceded by ';' (compiling source file ..\src\serialport_win.cpp) [D:\Projects\Desktop-projects\Electron-Boil
erplates\electron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(17): error C2144: syntax error: 'int' should
be preceded by ';' (compiling source file ..\src\serialport.cpp) [D:\Projects\Desktop-projects\Electron-Boilerpl
ates\electron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(18): error C2065: 'kMayContainHeapPointers':
undeclared identifier (compiling source file ..\src\serialport_win.cpp) [D:\Projects\Desktop-projects\Electron-B
oilerplates\electron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(18): error C2065: 'kMayContainHeapPointers':
undeclared identifier (compiling source file ..\src\serialport.cpp) [D:\Projects\Desktop-projects\Electron-Boile
rplates\electron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(18): error C2513: 'int': no variable declare
d before '=' (compiling source file ..\src\serialport_win.cpp) [D:\Projects\Desktop-projects\Electron-Boilerplate
s\electron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(18): error C2513: 'int': no variable declare
d before '=' (compiling source file ..\src\serialport.cpp) [D:\Projects\Desktop-projects\Electron-Boilerplates\el
ectron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(18): error C2143: syntax error: missing ';'
before ',' (compiling source file ..\src\serialport_win.cpp) [D:\Projects\Desktop-projects\Electron-Boilerplates\
electron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(18): error C2143: syntax error: missing ';'
before ',' (compiling source file ..\src\serialport.cpp) [D:\Projects\Desktop-projects\Electron-Boilerplates\elec
tron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(18): error C2059: syntax error: ',' (compili
ng source file ..\src\serialport_win.cpp) [D:\Projects\Desktop-projects\Electron-Boilerplates\electron-boilplate-
v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(18): error C2059: syntax error: ',' (compili
ng source file ..\src\serialport.cpp) [D:\Projects\Desktop-projects\Electron-Boilerplates\electron-boilplate-v140
\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(22): error C2143: syntax error: missing ';'
before '}' (compiling source file ..\src\serialport_win.cpp) [D:\Projects\Desktop-projects\Electron-Boilerplates\
electron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(22): error C2143: syntax error: missing ';'
before '}' (compiling source file ..\src\serialport.cpp) [D:\Projects\Desktop-projects\Electron-Boilerplates\elec
tron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(24): error C2059: syntax error: '}' (compili
ng source file ..\src\serialport_win.cpp) [D:\Projects\Desktop-projects\Electron-Boilerplates\electron-boilplate-
v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(24): error C2059: syntax error: '}' (compili
ng source file ..\src\serialport.cpp) [D:\Projects\Desktop-projects\Electron-Boilerplates\electron-boilplate-v140
\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(24): error C2143: syntax error: missing ';'
before '}' (compiling source file ..\src\serialport_win.cpp) [D:\Projects\Desktop-projects\Electron-Boilerplates\
electron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\cppgc/common.h(24): error C2143: syntax error: missing ';'
before '}' (compiling source file ..\src\serialport.cpp) [D:\Projects\Desktop-projects\Electron-Boilerplates\elec
tron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\v8-internal.h(16): error C2143: syntax error: missing ';' b
efore '{' (compiling source file ..\src\serialport.cpp) [D:\Projects\Desktop-projects\Electron-Boilerplates\elect
ron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\v8-internal.h(16): error C2143: syntax error: missing ';' b
efore '{' (compiling source file ..\src\serialport_win.cpp) [D:\Projects\Desktop-projects\Electron-Boilerplates\e
lectron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\v8-internal.h(16): error C2447: '{': missing function heade
r (old-style formal list?) (compiling source file ..\src\serialport.cpp) [D:\Projects\Desktop-projects\Electron-B
oilerplates\electron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\v8-internal.h(16): error C2447: '{': missing function heade
r (old-style formal list?) (compiling source file ..\src\serialport_win.cpp) [D:\Projects\Desktop-projects\Electr
on-Boilerplates\electron-boilplate-v140\app\node_modules\@serialport\bindings\build\bindings.vcxproj]
c:\users\chengcheng\.electron-gyp\11.0.3\include\node\v8.h(1224): error C2039: 'Address': is not a member of 'v8:
:internal' (compiling source file ..\src\serialport.cpp)c:\users\chengcheng\.electron-gyp\11.0.3\include\node\v8.
h(1224): error C2039: 'Address': is not a member of 'v8::internal' (compiling source file ..\src\serialport_win.c
pp) [D:\Projects\Desktop-projects\Electron-Boilerplates\electron-boilplate-v140\app\node_modules\@serialport\bind
ings\build\bindings.vcxproj]
Versions, Operating System and Hardware
- SerialPort v9.0.4
- Electron v11.0.3
- Node.js v12.18.1
- Windows 10 64bit
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (8 by maintainers)
Success! it was able to re-build serialport, but then died while re-building the native xml library i use lol
im also working on getting a clean windows vm install so i can try from a slightly less janky windows install