Open Tianming-Wu opened 1 year ago
或者说,有不少编译报错……这合理吗
Full build log:
PS C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings> node-gyp rebuild --target=22.3.18 --arch=x64 --dist-url=https://electronjs.org/headers
gyp info it worked if it ends with ok
gyp info using node-gyp@9.4.0
gyp info using node@18.17.1 | win32 | x64
gyp info find Python using Python version 3.11.5 found at "C:\Users\31853\AppData\Local\Programs\Python\Python311\python.exe"
gyp info find VS using VS2022 (17.7.34024.191) found at:
gyp info find VS "D:\AppLocate\Program Files\Microsoft Visual Studio\2022\Community"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Users\31853\AppData\Local\Programs\Python\Python311\python.exe
gyp info spawn args [
gyp info spawn args 'C:\\Users\\31853\\AppData\\Roaming\\npm\\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 'C:\\Users\\31853\\.vscode\\extensions\\hancel.serialport-helper-0.0.15\\node_modules\\@serialport\\bindings\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\31853\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\31853\\AppData\\Local\\node-gyp\\Cache\\22.3.18\\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\\31853\\AppData\\Local\\node-gyp\\Cache\\22.3.18',
gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\31853\\AppData\\Roaming\\npm\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\31853\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\22.3.18\\\\<(target_arch)\\\\node.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\Users\\31853\\.vscode\\extensions\\hancel.serialport-helper-0.0.15\\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 'C:\\Users\\31853\\.vscode\\extensions\\hancel.serialport-helper-0.0.15\\node_modules\\@serialport\\bindings\\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn D:\AppLocate\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\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 ]
serialport.cpp
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan_callbacks.h(55,23): error C2039: "AccessorSignature": 不是 "v8" 的成员
[C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\AppData\Local\node-gyp\Cache\22.3.18\include\node\v8.h(71,11): message : 参见“v8”的声明 [C:\Users\31853\.vscode\extensions\hancel.serialport-h
elper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan_callbacks.h(55,23): error C2065: “AccessorSignature”: 未声明的标识符 [C:
\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan_callbacks.h(55,13): error C2923: "v8::Local": "AccessorSignature"
不是参数 "T" 的有效 模板 类型参数 [C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan_callbacks.h(55,23): message : 参见“AccessorSignature”的声明 [C:\Users\
31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan_callbacks.h(55,42): error C2955: “v8::Local”: 使用 类 模板 需要 模板 参数列表
[C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\AppData\Local\node-gyp\Cache\22.3.18\include\node\v8-local-handle.h(155,13): message : 参见“v8::Local”的声明 [C:\Users\31853\.vscode\extension
s\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan.h(2516,14): error C2955: “v8::Local”: 使用 类 模板 需要 模板 参数
列表 [C:\User
s\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\AppData\Local\node-gyp\Cache\22.3.18\include\node\v8-local-handle.h(155,13): message : 参见“v8::Local”的声明 [C:\Users\31853\.vscode\extension
s\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan.h(2516,34): error C2641: 无法推导“v8::Local”的模板参数 [C:\Users\31853\.vs
code\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan.h(2516,34): error C2780: “v8::Local<T> v8::Local(T *)”: 应输入 1 个参数
,却提供了 0 个 [C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\AppData\Local\node-gyp\Cache\22.3.18\include\node\v8-local-handle.h(317,3): message : 参见“v8::Local”的声明 [C:\Users\31853\.vscode\extensions
\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan.h(2516,34): error C2780: “v8::Local<T> v8::Local(v8::Local<S>)”:
应输入 1 个参数,却提供了 0 个 [C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\AppData\Local\node-gyp\Cache\22.3.18\include\node\v8-local-handle.h(159,3): message : 参见“v8::Local”的声明 [C:\Users\31853\.vscode\extensions
\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan.h(2516,34): error C2783: “v8::Local<T> v8::Local(void)”: 无法推导“T”的
模板 参数 [C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\AppData\Local\node-gyp\Cache\22.3.18\include\node\v8-local-handle.h(157,3): message : 参见“v8::Local”的声明 [C:\Users\31853\.vscode\extensions
\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan.h(2516,34): error C2780: “v8::Local<T> v8::Local(v8::Local<T>)”:
应输入 1 个参数,却提供了 0 个 [C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\AppData\Local\node-gyp\Cache\22.3.18\include\node\v8-local-handle.h(155,13): message : 参见“v8::Local”的声明 [C:\Users\31853\.vscode\extension
s\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan.h(2542,6): error C2665: “v8::ObjectTemplate::SetAccessor”: 没有重 载函数
可以转换所有参数类型 [C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\AppData\Local\node-gyp\Cache\22.3.18\include\node\v8-template.h(814,8): message : 可能是“void v8::ObjectTemplate::SetAccessor(v8::Local<v8::
Name>,v8::AccessorNameGetterCallback,v8::AccessorNameSetterCallback,v8::Local<v8::Value>,v8::AccessControl,v8::PropertyAttribute,v8::SideEffectType,v8::
SideEffectType)” [C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan.h(2542,6): message : “void v8::ObjectTemplate::SetAccessor(v8::Lo
cal<v8::Name>,v8::AccessorNameGetterCallback,v8::AccessorNameSetterCallback,v8::Local<v8::Value>,v8::AccessControl,v8::PropertyAttribute,v8::SideEffectT
ype,v8::SideEffectType)”: 无法将参数 7 从“Nan::imp::Sig”转换为“v8::SideEffectType” [C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_module
s\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan.h(2549,7): message : 没有可用于执行该转换的用户定义的转换运算符, 或者无法调用该运算符 [C:\Users\3
1853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\AppData\Local\node-gyp\Cache\22.3.18\include\node\v8-template.h(807,8): message : 或 “void v8::ObjectTemplate::SetAccessor(v8::Local<v8
::String>,v8::AccessorGetterCallback,v8::AccessorSetterCallback,v8::Local<v8::Value>,v8::AccessControl,v8::PropertyAttribute,v8::SideEffectType,v8::Side
EffectType)” [C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan.h(2542,6): message : “void v8::ObjectTemplate::SetAccessor(v8::Lo
cal<v8::String>,v8::AccessorGetterCallback,v8::AccessorSetterCallback,v8::Local<v8::Value>,v8::AccessControl,v8::PropertyAttribute,v8::SideEffectType,v8
::SideEffectType)”: 无法将参数 2 从“Nan::imp::NativeGetter”转换为“v8::AccessorGetterCallback” [C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\
node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan.h(2544,7): message : 此转换需要 reinterpret_cast、C 样式强制转换或带圆括号函数样式强制转换
[C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\nan\nan.h(2542,6): message : 尝试匹配参数列表“(v8::Local<v8::String>, Nan::imp::N
ativeGetter, Nan::imp::NativeSetter, v8::Local<v8::Object>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)”时 [C:\Users\31853\.vscode\extension
s\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings\build\bindings.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `D:\AppLocate\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\31853\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:203:23)
gyp ERR! stack at ChildProcess.emit (node:events:514:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.19045
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\31853\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=22.3.18" "--arch=x64" "--dist-url=https://electronjs.org/headers"
gyp ERR! cwd C:\Users\31853\.vscode\extensions\hancel.serialport-helper-0.0.15\node_modules\@serialport\bindings
gyp ERR! node -v v18.17.1
gyp ERR! node-gyp -v v9.4.0
gyp ERR! not ok
rebuild is also failing for me.
This is too bad... I'm sure I haven't edited any of the files. But the compiler claims that there are errors.
版本: 1.81.1 (system setup) 提交: 6c3e3dba23e8fadc360aed75ce363ba185c49794 日期: 2023-08-09T22:22:42.175Z Electron: 22.3.18 ElectronBuildId: 22689846 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19045
By the way, which is the version said in the "How To Build SerialPort Node module" page:
node-gyp rebuild --target=<electron version> --arch=<ia32/x64> --dist-url=https://electronjs.org/headers
I tried 22.3.18, but I'm not sure, nor "platform". I tried ia32 and x64.
Weird(