Skip to content

Update to minimum node-gyp 9.1 for build on Windows #28766

@MikeMcC399

Description

@MikeMcC399

What would you like?

Enable building Cypress from source on Windows with node-gyp@9.1.0 or later when executing yarn on this repository according to CONTRIBUTING > Getting Started.

Why is this needed?

node-gyp recommends for Windows:

Install Visual C++ Build Environment: Visual Studio Build Tools (using "Visual C++ build tools" if using a version older than VS2019, otherwise use "Desktop development with C++" workload) or Visual Studio Community (using the "Desktop development with C++" workload)

  • Following on from issue node-gyp build error "missing any Windows SDK" #28703, in order to build Cypress from source on Windows 10 or Windows 11, the Windows 10 SDK of Visual Studio C++ environment must be installed. If the instructions from node-gyp are followed to the letter, then only the Windows 11 SDK is installed by default on Windows 10 or Windows 11. The Cypress build uses node-gyp@8.4.1 and fails with the error:

    stack Error: Could not find any Visual Studio installation to use

  • The workaround is to additionally install a Windows 10 SDK which allows node-gyp to recognize that Visual Studio is installed.

  • A more solid resolution (as opposed to a workaround) is to allow building Cypress from source using a version of node-gyp@9.1.0 or higher which includes support for recognizing the presence of a Windows 11 SDK.

Other

The version of node-gyp used is not explicitly specified by Cypress. It is dependent on the versions of other npm modules installed such as semantic-release and lerna.

Note that this enhancement request is not sufficient to support building with Python 3.12. This would require a minimum of node-gyp@10.0.0 which takes care of the removal of distutils in Python 3.12.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions