Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to yarn install with VS2022 build tools #138572

Closed
JJRcop opened this issue Dec 7, 2021 · 5 comments · Fixed by #142667
Closed

Unable to yarn install with VS2022 build tools #138572

JJRcop opened this issue Dec 7, 2021 · 5 comments · Fixed by #142667
Assignees
Labels
electron-16-update Issues related to electron 16 update insiders-released Patch has been released in VS Code Insiders vscode-build VS Code build process issues windows VS Code on Windows issues
Milestone

Comments

@JJRcop
Copy link
Contributor

JJRcop commented Dec 7, 2021

Does this issue occur when all extensions are disabled?: N/A

  • VS Code Version: main @ 470cee7
  • OS Version: Windows 10 Home 21H1 19043.1348 Windows Feature Experience Pack 120.2212.3920.0

Steps to Reproduce:

  1. Don't have Visual Studio 2019 installed anywhere
  2. Install prerequisites including Node.js but don't install native c++ build tools
  3. Install Visual Studio Build Tools 2022 separately
  4. Attempt to run yarn install

Result:

Receive error from build\npm\preinstall.js:

Invalid C/C++ Compiler Toolchain. Please check https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites.

This is because Visual Studio Build Tools 2022 installs to C:\Program Files (x86)\Microsoft Visual Studio\2022, but build\npm\preinstall.js does not consider 2022 to be a supported version, only 2019 and 2017.

const supportedVersions = ['2019', '2017'];

I would prefer to save disk space and avoid installing Visual Studio Build Tools 2019 when I already have 2022 installed.

@joaomoreno
Copy link
Member

Forwarding it to @deepak1556 in case he'd like to update our docs to include 2022 as well. Otherwise, we close it.

@deepak1556
Copy link
Contributor

I haven't tested with 2022 yet, @JJRcop is rest of the yarn step successful after bypassing the preinstall step ?

@deepak1556 deepak1556 added vscode-build VS Code build process issues windows VS Code on Windows issues labels Jan 4, 2022
@JJRcop
Copy link
Contributor Author

JJRcop commented Jan 4, 2022

Adding '2022' to the supportedVersions array works with node-gyp version v8.4.0 or later. When I made this issue, I was on v8.3.9, where it didn't work.

Upgrading node-gyp to v8.4.1 fixed install, and yarn install works without issue on VS2022.

https://github.com/nodejs/node-gyp/releases/tag/v8.4.0

So, yes.

@deepak1556
Copy link
Contributor

Thanks for testing, given that this requires node-gyp >=8.4.0 which also brings in nodejs/node-gyp@a27dc08, it won't build the native modules on the main branch correctly due to older electron version. We can add 2022 to the list once #137241 lands.

@deepak1556 deepak1556 added the electron-16-update Issues related to electron 16 update label Jan 4, 2022
@deepak1556 deepak1556 added this to the January 2022 milestone Jan 4, 2022
@deepak1556
Copy link
Contributor

@JJRcop main branch is now updated to Electron 16, do you want to send a PR to add 2022 to the supported list ? Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
electron-16-update Issues related to electron 16 update insiders-released Patch has been released in VS Code Insiders vscode-build VS Code build process issues windows VS Code on Windows issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@joaomoreno @deepak1556 @JJRcop and others