安装node-cld遇C7626错误,求助解决(外部库不可修改)
求助:npm安装quip-api时出现C7626编译错误
此问题并非常见的「Error C7626: Unnamed class used in typedef name cannot declare members other than non-static data members」问题,因为错误出现在无法修改的外部依赖库中,且仅在特定机器环境下触发。
我尝试构建quip-api仓库,执行npm install时遇到以下编译错误:
npm error code 1 npm error path C:\Users\******\source\repos\quip-api\node_modules\cld npm error command failed npm error command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild npm error cldutil.cc npm error C:\Users\******\source\repos\quip-api\node_modules\cld\deps\cld\internal\scoreonescriptspan.h(117,16): error C7626: unnamed class used in typedef name cannot declare members other than non-static data members, member enumerations, or member classes [C:\Users\******\source\repos\quip-api\node_modules\cld\build\deps\cld\cld-c.vcxproj] npm error (compiling source file '../../../deps/cld/internal/cldutil.cc') npm error npm error C:\Users\******\source\repos\quip-api\node_modules\cld\deps\cld\internal\scoreonescriptspan.h(132,16): error C7626: unnamed class used in typedef name cannot declare members other than non-static data members, member enumerations, or member classes [C:\Users\******\source\repos\quip-api\node_modules\cld\build\deps\cld\cld-c.vcxproj] npm error (compiling source file '../../../deps/cld/internal/cldutil.cc') npm error npm error C:\Users\******\source\repos\quip-api\node_modules\cld\deps\cld\internal\scoreonescriptspan.h(186,16): error C7626: unnamed class used in typedef name cannot declare members other than non-static data members, member enumerations, or member classes [C:\Users\******\source\repos\quip-api\node_modules\cld\build\deps\cld\cld-c.vcxproj] npm error (compiling source file '../../../deps/cld/internal/cldutil.cc') npm error gyp info it worked if it ends with ok npm error gyp info using node-gyp@10.2.0 npm error gyp info using node@23.0.0 | win32 | x64 npm error gyp info find Python using Python version 3.12.6 found at "C:\Python312\python.exe" npm error (node:6376) ExperimentalWarning: Support for loading ES Module in require() is an experimental feature and might change at any time npm error (Use `node --trace-warnings ...` to show where the warning was created) npm error gyp info find VS using VS2022 (17.11.35327.3) found at: npm error gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community" npm error gyp info find VS run with --verbose for detailed information npm error gyp info spawn C:\Python312\python.exe npm error gyp info spawn args [ npm error gyp info spawn args 'C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py', npm error gyp info spawn args 'binding.gyp', npm error gyp info spawn args '-f', npm error gyp info spawn args 'msvs', npm error gyp info spawn args '-I', npm error gyp info spawn args 'C:\Users\******\source\repos\quip-api\node_modules\cld\build\config.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args 'C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\addon.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args 'C:\Users\******\AppData\Local\node-gyp\Cache\23.0.0\include\node\common.gypi', npm error gyp info spawn args '-Dlibrary=shared_library', npm error gyp info spawn args '-Dvisibility=default', npm error gyp info spawn args '-Dnode_root_dir=C:\Users\******\AppData\Local\node-gyp\Cache\23.0.0', npm error gyp info spawn args '-Dnode_gyp_dir=C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp', npm error gyp info spawn args '-Dnode_lib_file=C:\\Users\\******\\AppData\\Local\\node-gyp\\Cache\\23.0.0\\<(target_arch)\\node.lib', npm error gyp info spawn args '-Dmodule_root_dir=C:\Users\******\source\repos\quip-api\node_modules\cld', npm error gyp info spawn args '-Dnode_engine=v8', npm error gyp info spawn args '--depth=.', npm error gyp info spawn args '--no-parallel', npm error gyp info spawn args '--generator-output', npm error gyp info spawn args 'C:\Users\******\source\repos\quip-api\node_modules\cld\build', npm error gyp info spawn args '-Goutput_dir=.' npm error gyp info spawn args ] npm error gyp info spawn C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe npm error gyp info spawn args [ npm error gyp info spawn args 'build\binding.sln', npm error gyp info spawn args '/clp:Verbosity=minimal', npm error gyp info spawn args '/nologo', npm error gyp info spawn args '/p:Configuration=Release;Platform=x64' npm error gyp info spawn args ] npm error gyp ERR! build error npm error gyp ERR! stack Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1 npm error gyp ERR! stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:216:23) npm error gyp ERR! stack at ChildProcess.emit (node:events:507:28) npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12) npm error gyp ERR! System Windows_NT 10.0.22631 npm error gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" npm error gyp ERR! cwd C:\Users\******\source\repos\quip-api\node_modules\cld npm error gyp ERR! node -v v23.0.0 npm error gyp ERR! node-gyp -v v10.2.0 npm error gyp ERR! not ok npm error A complete log of this run can be found in: C:\Users\******\AppData\Local\npm-cache\_logs\2024-11-06T17_28_31_391Z-debug-0.log
有没有人能帮忙解决这个问题?
内容的提问来源于stack exchange,提问作者Mr. X
相关产品推荐
相关产品推荐

