microsoft / node-pty

Fork pseudoterminals in Node.JS
Other
1.47k stars 239 forks source link

Update Windows Installation Prerequisite #645

Closed Elkiwa closed 5 months ago

Elkiwa commented 10 months ago

Environment details

Issue description

While installing with npm under node v21.4.0

npm install -g node-pty

It failed and produced the following messages for 3 .vcxproj files, namely: conpty, conpty_console_list, and pty

npm ERR! C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(504,5): error MSB8040: Spectre-mitigated libraries are required for this project. Install them from the Visual Studio installer (Individual components tab) for any toolsets and architectures being used. Learn more: https://aka.ms/Ofhn4c [<my nodejs path>\bin\node_modules\node-pty\build\conpty.vcxproj]

Luckily, I was able to resolve this with installing MSVC v143 - VS 2022 C++ x64/x86 Spectre-mitigated libs (v14.38-17.8) image

Thus, the Windows Installation Prerequisite description is quite outdated.

Windows SDK - only the "Desktop C++ Apps" components are needed to be installed

  1. Not only Desktop Development with C++ under "Workloads" tab, but also the corresponding Spectre-mitigated libs under "Individual components" tab are needed
  2. (Optional) https://www.npmjs.com/package/windows-build-tools is not needed for newer Node.js env
    npm WARN deprecated windows-build-tools@5.2.2: Node.js now includes build tools for Windows. You probably no longer need this tool. See https://github.com/felixrieseberg/windows-build-tools for details.`
alphaleadership commented 9 months ago

And node module version throw error

alphaleadership commented 9 months ago

With lts version

eric-gonzalez-tfs commented 6 months ago

Would be great to get this updated in the README. Thanks for posting your solution @Elkiwa