opensumi / ide-electron

OpenSumi Electron Version
https://opensumi.com
MIT License
171 stars 56 forks source link

ide-electron clone后,首次编译报错 #110

Closed alex-jh-jiang closed 1 month ago

alex-jh-jiang commented 1 month ago

系统:Windows11 node版本:node@18.20.4 node-gyp版本:10.1.0

错误log

C:\Users\jiang\Documents\gits\opensumi\ide-electron>pnpm i  WARN  deprecated electron-rebuild@3.2.9: Please use @electron/rebuild moving forward. There is no API change, just a package name change  WARN  deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported  WARN  deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142  WARN  22 deprecated subdependencies found: @humanwhocodes/config-array@0.11.14, @humanwhocodes/object-schema@2.0.3, @npmcli/move-file@2.0.1, @opensumi/vscode-ripgrep@1.4.0, are-we-there-yet@3.0.1, asar@3.2.0, core-js@2.6.12, cross-spawn-async@2.2.5, electron-osx-sign@0.6.0, gauge@4.0.4, glob@7.2.3, glob@8.1.0, har-validator@5.1.5, inflight@1.0.6, npmlog@6.0.2, spdlog@0.9.0, uuid@3.4.0, xterm-addon-canvas@0.4.0, xterm-addon-fit@0.7.0, xterm-addon-search@0.12.0, xterm-addon-webgl@0.15.0, xterm@5.3.0 Packages: +1057 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Progress: resolved 1066, reused 1063, downloaded 0, added 1057, done node_modules/.pnpm/node-pty@1.0.0/node_modules/node-pty: Running install script, failed in 57.3s .../node-pty@1.0.0/node_modules/node-pty install$ node-gyp rebuild │ C:\Users\jiang\Documents\gits\opensumi\ide-electron\node_modules.pnpm\node-pty@1.0.0\node_modules\node-pty>if not defined npm_config_node_gyp (node "C:\Users\jiang\AppData\Roaming\npm\node_mo… │ gyp info it worked if it ends with ok │ gyp info using node-gyp@10.1.0 │ gyp info using node@18.20.4 | win32 | x64 │ gyp info find Python using Python version 3.12.4 found at "C:\Python312\python.exe" │ gyp info find VS using VS2019 (16.11.34301.259) found at: │ gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools" │ gyp info find VS run with --verbose for detailed information │ gyp info spawn C:\Python312\python.exe │ gyp info spawn args [ │ gyp info spawn args 'C:\Users\jiang\AppData\Roaming\npm\node_modules\pnpm\dist\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\jiang\Documents\gits\opensumi\ide-electron\node_modules\.pnpm\node-pty@1.0.0\node_modules\node-pty\build\config.gypi', │ gyp info spawn args '-I', │ gyp info spawn args 'C:\Users\jiang\AppData\Roaming\npm\node_modules\pnpm\dist\node_modules\node-gyp\addon.gypi', │ gyp info spawn args '-I', │ gyp info spawn args 'C:\Users\jiang\AppData\Local\node-gyp\Cache\18.20.4\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\jiang\AppData\Local\node-gyp\Cache\18.20.4', │ gyp info spawn args '-Dnode_gyp_dir=C:\Users\jiang\AppData\Roaming\npm\node_modules\pnpm\dist\node_modules\node-gyp', │ gyp info spawn args '-Dnode_lib_file=C:\\Users\\jiang\\AppData\\Local\\node-gyp\\Cache\\18.20.4\\<(target_arch)\\node.lib', │ gyp info spawn args '-Dmodule_root_dir=C:\Users\jiang\Documents\gits\opensumi\ide-electron\node_modules\.pnpm\node-pty@1.0.0\node_modules\node-pty', │ 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\jiang\Documents\gits\opensumi\ide-electron\node_modules\.pnpm\node-pty@1.0.0\node_modules\node-pty\build', │ gyp info spawn args '-Goutput_dir=.' │ gyp info spawn args ] │ gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\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 ] │ 在此解决方案中一次生成一个项目。若要启用并行生成,请添加“-m”开关。 │ C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(486,5): error MSB8040: 此项目需要缓解了 Spectre 漏洞的库。从 Visual Studio … │ C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(486,5): error MSB8040: 此项目需要缓解了 Spectre 漏洞的库。从 Visual Studio … │ Agent.cc │ AgentCreateDesktop.cc │ ConsoleFont.cc │ ConsoleInput.cc │ ConsoleInputReencoding.cc │ ConsoleLine.cc │ DebugShowInput.cc │ DefaultInputMap.cc │ EventLoop.cc │ InputMap.cc │ LargeConsoleRead.cc │ NamedPipe.cc │ Scraper.cc │ Terminal.cc │ Win32Console.cc │ Win32ConsoleBuffer.cc │ main.cc │ BackgroundDesktop.cc │ Buffer.cc │ DebugClient.cc │ GenRandom.cc │ OwnedHandle.cc │ StringUtil.cc │ WindowsSecurity.cc │ WindowsVersion.cc │ WinptyAssert.cc │ WinptyException.cc │ WinptyVersion.cc │ win_delay_load_hook.cc │ 正在生成代码 │ Previous IPDB not found, fall back to full compilation. │ C:\Users\jiang\Documents\gits\opensumi\ide-electron\node_modules.pnpm\node-pty@1.0.0\node_modules\node-pty\deps\winpty\src\agent\Agent.cc(231): warning C4722: “Agent::~Agent”: 析构函数永远不… │ All 1772 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. │ 已完成代码的生成 │ winpty-agent.vcxproj -> C:\Users\jiang\Documents\gits\opensumi\ide-electron\node_modules.pnpm\node-pty@1.0.0\node_modules\node-pty\build\Release\winpty-agent.exe │ AgentLocation.cc │ winpty.cc │ BackgroundDesktop.cc │ Buffer.cc │ DebugClient.cc │ GenRandom.cc │ OwnedHandle.cc │ StringUtil.cc │ WindowsSecurity.cc │ WindowsVersion.cc │ WinptyAssert.cc │ WinptyException.cc │ WinptyVersion.cc │ win_delay_load_hook.cc │ 正在创建库 C:\Users\jiang\Documents\gits\opensumi\ide-electron\node_modules.pnpm\node-pty@1.0.0\node_modules\node-pty\build\Release\winpty.lib 和对象 C:\Users\jiang\Documents\gits\opensum… │ 正在生成代码 │ Previous IPDB not found, fall back to full compilation. │ All 1056 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. │ 已完成代码的生成 │ winpty.vcxproj -> C:\Users\jiang\Documents\gits\opensumi\ide-electron\node_modules.pnpm\node-pty@1.0.0\node_modules\node-pty\build\Release\winpty.dll │ gyp ERR! build error │ gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe failed with exit code: 1 │ gyp ERR! stack at ChildProcess. (C:\Users\jiang\AppData\Roaming\npm\node_modules\pnpm\dist\node_modules\node-gyp\lib\build.js:209:23) │ gyp ERR! stack at ChildProcess.emit (node:events:517:28) │ gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:292:12) │ gyp ERR! System Windows_NT 10.0.22000 │ gyp ERR! command "C:\nodejs\node.exe" "C:\Users\jiang\AppData\Roaming\npm\node_modules\pnpm\dist\node_modules\node-gyp\bin\node-gyp.js" "rebuild" │ gyp ERR! cwd C:\Users\jiang\Documents\gits\opensumi\ide-electron\node_modules.pnpm\node-pty@1.0.0\node_modules\node-pty │ gyp ERR! node -v v18.20.4 │ gyp ERR! node-gyp -v v10.1.0 │ gyp ERR! not ok └─ Failed in 57.3s at C:\Users\jiang\Documents\gits\opensumi\ide-electron\node_modules.pnpm\node-pty@1.0.0\node_modules\node-pty  ELIFECYCLE  Command failed with exit code 1.

alex-jh-jiang commented 1 month ago

请问这个问题可以怎么解决?困扰好几天的,感谢!

Ricbet commented 1 month ago

参考一下这个文档 https://opensumi.com/zh/docs/develop/how-to-contribute#%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87

erha19 commented 1 month ago

看着就是 node-pty 安装存在问题,可以定向搜搜解法

erha19 commented 1 month ago

看着就是 node-pty 安装存在问题,可以定向搜搜解法

alex-jh-jiang commented 1 month ago

将nodejs版本由18,降到node-v14.21.3-x64,再默认安装nodejs windows相关编译工具。还有些过程中报错做了些微调,基本网上可以找到应对方法。如:

其他过程中报错及解决 1、ModuleNotFoundError: No module named 'distutils' pip install setuptools

2、D:\code\opensumi\ide-electron\node_modules\node-gyp\gyp\pylib\gyp\input.py,有个rU调整为r

hacke2 commented 1 month ago

resolve #111