nodejs / node-gyp

Node.js native addon build tool
MIT License
9.95k stars 1.8k forks source link

node-pty build error on Windows #3091

Open Yu-YuZhang opened 6 days ago

Yu-YuZhang commented 6 days ago

error G:\HtmlCode\ide-startup\node_modules\node-pty: Command failed. Exit code: 1 Command: node-gyp rebuild Arguments: Directory: G:\HtmlCode\ide-startup\node_modules\node-pty Output: gyp info it worked if it ends with ok gyp info using node-gyp@10.2.0 gyp info using node@18.17.0 | win32 | x64 gyp info find Python using Python version 3.8.20 found at "G:\miniconda3\envs\py38env\python.exe"

gyp http GET https://nodejs.org/download/release/v18.17.0/node-v18.17.0-headers.tar.gz gyp http 200 https://nodejs.org/download/release/v18.17.0/node-v18.17.0-headers.tar.gz gyp http GET https://nodejs.org/download/release/v18.17.0/SHASUMS256.txt gyp http GET https://nodejs.org/download/release/v18.17.0/win-x64/node.lib gyp http 200 https://nodejs.org/download/release/v18.17.0/SHASUMS256.txt gyp http 200 https://nodejs.org/download/release/v18.17.0/win-x64/node.lib gyp info find VS using VS2017 (15.9.35324.217) found at: gyp info find VS "G:\Microsoft Visual Studio\2017\Enterprise" gyp info find VS run with --verbose for detailed information gyp info spawn G:\miniconda3\envs\py38env\python.exe gyp info spawn args [ gyp info spawn args 'C:\Users\YuTong\AppData\Local\Yarn\Data\global\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 'G:\HtmlCode\ide-startup\node_modules\node-pty\build\config.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\Users\YuTong\AppData\Local\Yarn\Data\global\node_modules\node-gyp\addon.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\Users\YuTong\AppData\Local\node-gyp\Cache\18.17.0\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\YuTong\AppData\Local\node-gyp\Cache\18.17.0', gyp info spawn args '-Dnode_gyp_dir=C:\Users\YuTong\AppData\Local\Yarn\Data\global\node_modules\node-gyp', gyp info spawn args '-Dnode_lib_file=C:\\Users\\YuTong\\AppData\\Local\\node-gyp\\Cache\\18.17.0\\<(target_arch)\\node.lib', gyp info spawn args '-Dmodule_root_dir=G:\HtmlCode\ide-startup\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 'G:\HtmlCode\ide-startup\node_modules\node-pty\build', gyp info spawn args '-Goutput_dir=.' gyp info spawn args ] gyp info spawn G:\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.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 ] �ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ������ӡ�/m�����ء� G:\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(402,5): warning MSB8038: ������ Spectre ���⣬���Ҳ��� Spectre ����⡣��֤ Visual Studio �������ɰ��� Spectre ����⡣�й���ϸ��Ϣ������� https://aka.ms/Ofhn4c�� [G:\HtmlCode\ide-startup\node_modules\node-pty\build\conpty.vcxproj] conpty.cc path_util.cc win_delay_load_hook.cc LINK : fatal error LNK1181: �޷��������ļ���DelayImp.lib�� [G:\HtmlCode\ide-startup\node_modules\node-pty\build\conpty.vcxproj] G:\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(402,5): warning MSB8038: ������ Spectre ���⣬���Ҳ��� Spectre ����⡣��֤ Visual Studio �������ɰ��� Spectre ����⡣�й���ϸ��Ϣ������� https://aka.ms/Ofhn4c�� [G:\HtmlCode\ide-startup\node_modules\node-pty\build\conpty_console_list.vcxproj] conpty_console_list.cc win_delay_load_hook.cc LINK : fatal error LNK1181: �޷��������ļ���DelayImp.lib�� [G:\HtmlCode\ide-startup\node_modules\node-pty\build\conpty_console_list.vcxproj] 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 �������ɴ��� g:\htmlcode\ide-startup\node_modules\node-pty\deps\winpty\src\agent\agent.cc(231): warning C4722: ��Agent::~Agent��: ����������Զ���᷵�أ����ܻᷢ���ڴ�й© [G:\HtmlCode\ide-startup\node_modules\node-pty\build\deps\winpty\src\winpty-agent.vcxproj]
All 1982 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. ����ɴ�������� winpty-agent.vcxproj -> G:\HtmlCode\ide-startup\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 ���ڴ����� G:\HtmlCode\ide-startup\node_modules\node-pty\build\Release\winpty.lib �Ͷ��� G:\HtmlCode\ide-startup\node_modules\node-pty\build\Release\winpty.exp �������ɴ��� All 1156 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. ����ɴ�������� winpty.vcxproj -> G:\HtmlCode\ide-startup\node_modules\node-pty\build\Release\winpty.dll gyp ERR! build error gyp ERR! stack Error: G:\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess. (C:\Users\YuTong\AppData\Local\Yarn\Data\global\node_modules\node-gyp\lib\build.js:216: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.22631 gyp ERR! command "F:\nvm\nodejs\nodejs\node.exe" "C:\Users\YuTong\AppData\Local\Yarn\Data\global\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd G:\HtmlCode\ide-startup\node_modules\node-pty

cclauss commented 6 days ago

https://github.com/search?q=repo%3Anodejs%2Fnode-gyp+node-pty&type=issues

Yu-YuZhang commented 5 days ago

https://github.com/search?q=repo%3Anodejs%2Fnode-gyp+node-pty&type=issues

Thanks

cclauss commented 5 days ago

Did you find a solution?

Yu-YuZhang commented 5 days ago

Did you find a solution?

I just tested it and it all failed. The error message is the same.

cclauss commented 5 days ago

Perhaps look at these issues https://github.com/microsoft/node-pty/issues

Yu-YuZhang commented 5 days ago

Hello, this problem still occurs after replacing VS2022. Please help me take a look.

error G:\HtmlCode\ide-startup\node_modules\node-pty: Command failed. Exit code: 1 Command: node-gyp rebuild Arguments: Directory: G:\HtmlCode\ide-startup\node_modules\node-pty Output: gyp info it worked if it ends with ok gyp info using node-gyp@10.2.0 gyp info using node@18.12.0 | win32 | x64 gyp info find Python using Python version 3.9.1 found at "G:\miniconda3\python.exe"

gyp info find VS using VS2022 (17.13.35507.96) found at: gyp info find VS "G:\Microsoft Visual Studio\2022\Preview" gyp info find VS run with --verbose for detailed information gyp info spawn G:\miniconda3\python.exe gyp info spawn args [ gyp info spawn args 'C:\Users\YuTong\AppData\Local\Yarn\Data\global\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 'G:\HtmlCode\ide-startup\node_modules\node-pty\build\config.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\Users\YuTong\AppData\Local\Yarn\Data\global\node_modules\node-gyp\addon.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\Users\YuTong\AppData\Local\node-gyp\Cache\18.12.0\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\YuTong\AppData\Local\node-gyp\Cache\18.12.0', gyp info spawn args '-Dnode_gyp_dir=C:\Users\YuTong\AppData\Local\Yarn\Data\global\node_modules\node-gyp', gyp info spawn args '-Dnode_lib_file=C:\\Users\\YuTong\\AppData\\Local\\node-gyp\\Cache\\18.12.0\\<(target_arch)\\node.lib', gyp info spawn args '-Dmodule_root_dir=G:\HtmlCode\ide-startup\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 'G:\HtmlCode\ide-startup\node_modules\node-pty\build', gyp info spawn args '-Goutput_dir=.' gyp info spawn args ] gyp info spawn G:\Microsoft Visual Studio\2022\Preview\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 ]

G:\Microsoft Visual Studio\2022\Preview\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(504,5): error MSB8040: 此项目需要缓解了 Spectre 漏洞的库。从 Visual Studio 安装程序(单个组件选项卡)为正在使用的任何工具集和体系结构安装它们。了解详信息: https://aka.ms/Ofhn4c [G:\HtmlCode\ide-startup\node_modules\node-pty\build\conpty.vcxproj] G:\Microsoft Visual Studio\2022\Preview\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(504,5): error MSB8040: 此项目需要缓解了 Spectre 漏洞的库。从 Visual Studio 安装程序(单个组件选项卡)为正在使用的任何工具集和体系结构安装它们。了解详信息: https://aka.ms/Ofhn4c [G:\HtmlCode\ide-startup\node_modules\node-pty\build\conpty_console_list.vcxproj] 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. G:\HtmlCode\ide-startup\node_modules\node-pty\deps\winpty\src\agent\Agent.cc(231): warning C4722: “Agent::~Agent”: 析构函数永远不会返回,可能会发生内存泄漏 [G:\HtmlCode\ide-startup\node_modules\node-pty\build\deps\winpty\src\winpty-agent.vcxproj] All 1735 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. 已完成代码的生成 winpty-agent.vcxproj -> G:\HtmlCode\ide-startup\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 正在创建库 G:\HtmlCode\ide-startup\node_modules\node-pty\build\Release\winpty.lib 和对象 G:\HtmlCode\ide-startup\node_modules\node-pty\build\Release\winpty.exp 正在生成代码 Previous IPDB not found, fall back to full compilation. All 1043 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. 已完成代码的生成 winpty.vcxproj -> G:\HtmlCode\ide-startup\node_modules\node-pty\build\Release\winpty.dll G:\Microsoft Visual Studio\2022\Preview\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(504,5): error MSB8040: 此项目需要缓解了 Spectre 漏洞的库。从 Visual Studio 安装程序(单个组件选项卡)为正在使用的任何工具集和体系结构安装它们。了解详信息: https://aka.ms/Ofhn4c [G:\HtmlCode\ide-startup\node_modules\node-pty\build\pty.vcxproj] gyp ERR! build error gyp ERR! stack Error: G:\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\MSBuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess. (C:\Users\YuTong\AppData\Local\Yarn\Data\global\node_modules\node-gyp\lib\build.js:216:23) gyp ERR! stack at ChildProcess.emit (node:events:513:28) gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12) gyp ERR! System Windows_NT 10.0.22631 gyp ERR! command "F:\nvm\nodejs\nodejs\node.exe" "C:\Users\YuTong\AppData\Local\Yarn\Data\global\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd G:\HtmlCode\ide-startup\node_modules\node-pty