cypress icon indicating copy to clipboard operation
cypress copied to clipboard

Win32-Arm64 Is not supported.

Open KimPlaybit opened this issue 1 year ago • 14 comments

What would you like?

Run a web application with Cypress on a computer with Win32-Arm64 OS.

Why is this needed?

With Asus recently releasing laptops with Qualcomm CPUs, this will be more and more requested. See The Asus Vivobook S 15.

Other

I managed to start my Web app with cypress regardless.

By adding in win32-arm64 as a valid OS in install.js and then hardcode so that "getUrl" in download.js returns "https://download.cypress.io/desktop/13.13.3?platform=win32&arch=x64". What side-effects this has is unknow.

KimPlaybit avatar Sep 18 '24 12:09 KimPlaybit

@KimPlaybit

Are you using Windows 11 24H2?

MikeMcC399 avatar Sep 18 '24 15:09 MikeMcC399

@KimPlaybit

Are you using Windows 11 24H2?

Yes, i am.

but i dont know if this matters? since the problem is that "validateOS" does not support "win32-arm64" and there is no download link for windows with an ARM CPU. I am using a windows Laptop with a Qualcomm Snapdragon(R) X Elite CPU.

KimPlaybit avatar Sep 19 '24 07:09 KimPlaybit

@KimPlaybit

Thanks for providing the details of your environment!

Cypress is built for win32-x64 only.

According to https://learn.microsoft.com/en-us/windows/arm/overview the emulation changed in Windows 11 24H2, so that is relevant.

MikeMcC399 avatar Sep 19 '24 09:09 MikeMcC399

@KimPlaybit

Thanks for providing the details of your environment!

Cypress is built for win32-x64 only.

According to https://learn.microsoft.com/en-us/windows/arm/overview the emulation changed in Windows 11 24H2, so that is relevant.

Alright, but this also states that with Windows 11 24H2 supports emulation of x64 apps. wouldnt that put cypress in that category?

Thus, when i enforced that https://download.cypress.io/desktop/13.13.3?platform=win32&arch=x64 would be downloaded is not wrong. other than that side-effects might happen.

-- Tho, Prism is specificly optimized and tuned for snapdragon.

KimPlaybit avatar Sep 19 '24 09:09 KimPlaybit

@KimPlaybit

I can't be of much help here as I don't have access to the hardware you're using.

Have you installed Node.js Windows arm64 or Node.js Windows x64? Reading the Node.js docs it seems like the x64 version of Node.js might give you a better experience, however I can't really say as I can't test this.

MikeMcC399 avatar Sep 19 '24 10:09 MikeMcC399

@KimPlaybit

I can't be of much help here as I don't have access to the hardware you're using.

Have you installed Node.js Windows arm64 or Node.js Windows x64? Reading the Node.js docs it seems like the x64 version of Node.js might give you a better experience, however I can't really say as I can't test this.

At the current moment i havnt found any issues yet. I am running Node.js Windows ARM64. If you like, i can report any issues i find.

i found this, https://learn.microsoft.com/en-us/windows/arm/arm64ec. Which suggests that Windows 11 ARM has been supporting x64 emulation for a while and that Windows 11 24h2 added "Prism", which is an optimization for Snapdragon.

windows 10 ARM however, do not support x64 emulation, might cause problems.

__

i believe i added this as a feature request. but maybe i should point that out.

KimPlaybit avatar Sep 19 '24 10:09 KimPlaybit

@KimPlaybit

i believe i added this as a feature request. but maybe i should point that out.

I understood it that way. The Cypress.io team may add a label accordingly.

In terms of using the emulation, it may simply be a question of testing and documentation.

Building Cypress for Windows arm64 would however be a major enhancement to the process and the documentation. https://www.arm.com/developer-hub/laptops-and-desktops

MikeMcC399 avatar Sep 19 '24 10:09 MikeMcC399

@KimPlaybit

i believe i added this as a feature request. but maybe i should point that out.

I understood it that way. The Cypress.io team may add a label accordingly.

In terms of using the emulation, it may simply be a question of testing and documentation.

Building Cypress for Windows arm64 would however be a major enhancement to the process and the documentation. https://www.arm.com/developer-hub/laptops-and-desktops

Building it for Windows arm64 would be great. But to add the label to run cypress with the emulator might be a good start tho.

KimPlaybit avatar Sep 19 '24 11:09 KimPlaybit

For the time being, I wonder if the Cypress team can redirect https://download.cypress.io/desktop/13.13.3?platform=win32&arch=arm64 to the win32-x64 version

alexsch01 avatar Sep 19 '24 12:09 alexsch01

With the disclaimer that running Cypress on Windows arm64 is unsupported, undocumented and untested:

  1. Try Node.js Windows x64, as the documentation os.arch() says:

Returns the operating system CPU architecture for which the Node.js binary was compiled. Possible values are 'arm', 'arm64', 'ia32', 'loong64', 'mips', 'mipsel', 'ppc', 'ppc64', 'riscv64', 's390', 's390x', and 'x64'.

  1. I don't think that making the CDN server deliver x64 when arm64 has been requested is a good thing to start doing. Use Advanced Installation, for instance in a Windows PowerShell terminal, and try the following to provide a workaround on the client-side:
$env:CYPRESS_DOWNLOAD_PATH_TEMPLATE='${endpoint}/win32-x64/cypress.zip'
$env:DEBUG='cypress:cli*'
npm install cypress --save-dev --ignore-scripts
npx cypress install --force

followed by

npx cypress verify
npx cypress open

to confirm.

Instead of install cypress, install cypress@latest or install cypress@<version> like install [email protected] will also be accepted.

MikeMcC399 avatar Sep 20 '24 06:09 MikeMcC399

~~Not sure that's feasible if cypress is installed through dev-dependencies. Some overriding method like an env variable CYPRESS_ARCH=x64 would be nice.~~ Okay, actually the core problem is, as briefly mentioned by OP, install.js outright bans win32-arm64 via validateOS(). Once there's a way to skip that, the download path template should work.

saschanaz avatar Sep 30 '24 19:09 saschanaz

A possible way forward would be to patch Cypress locally to allow downloading and installing a Cypress win32-x64 binary on win32-arm64 so that it could run in emulation mode. The Cypress documentation instructions on References > Troubleshooting > Patch Cypress describe how to add a patch to the installation process.

It would be good to have win32-arm64 runners available to test in CI, for instance to be able to test the https://github.com/cypress-io/cypress-example-kitchensink repo on Windows on Arm (WoA).

There is some work going on to provide such runners, however it seems that win32-arm64 runners are not yet generally available as free runners hosted on GitHub or on CircleCI.

GitHub Actions

  • https://www.arm.com/developer-hub/laptops-and-desktops/woa-appdev#cicd mentions using a WoA self-hosted runner.
  • https://github.blog/changelog/2024-06-03-actions-arm-based-linux-and-windows-runners-are-now-in-public-beta/ announced a public beta https://github.blog/news-insights/product-news/arm64-on-github-actions-powering-faster-more-efficient-build-systems/ , however currently the list on https://github.com/actions/partner-runner-images does not include Windows on Arm

CircleCI

  • https://circleci.com/docs/using-arm/ does not mention Windows and I could not find any mention of Windows on Arm plans for CircleCI. Edit: Asked in CircleCI forum Windows on Arm support?

MikeMcC399 avatar Oct 07 '24 08:10 MikeMcC399

You could use patch-package to update your Cypress for now to bypass the OS validation for now. That's our recommendation.

jennifer-shehane avatar Nov 05 '24 15:11 jennifer-shehane

I have a new Surface laptop with snapdragon CPU and i try to setup my angular packages via "npm i" with the same result as mentioned above:

npm error command failed npm error command C:\Windows\system32\cmd.exe /d /s /c node index.js --exec install npm error The Cypress App could not be installed. Your machine does not meet the operating system requirements. npm error npm error https://on.cypress.io/guides/getting-started/installing-cypress#system-requirements npm error npm error ---------- npm error npm error Platform: win32-arm64 (10.0.26100) npm error Cypress Version: 13.16.0

I have tried node.js for x64 and arm aswell as forcing the installation without resolving the issue. Is there anything new upcoming to have ARM support?

I cant deal with patch-package since its a restricted angular project.

Hig4tower avatar Nov 29 '24 20:11 Hig4tower

Solution for Cypress Installation Issue on Windows 11 (Surface Laptop) If you're facing issues installing Cypress on your Surface Laptop running Windows 11, particularly with ARM architecture, you can resolve this by manually downloading and setting up Cypress. Follow these steps:

Steps to Resolve the Issue Download the Cypress ZIP File:

Go to the (https://www.cypress.io/install)and download the appropriate Cypress version ZIP file (e.g., 13.17.0). Extract the ZIP File:

After downloading, extract the contents of the ZIP file to a folder on your PC. Move the Extracted Folder:

Move the extracted Cypress folder to the following directory on your PC:

C:\Users{username}\AppData\Local\Cypress\Cache\13.17.0 Make sure to replace {username} with your actual Windows username.

Run Cypress Commands:

You should now be able to execute the following Cypress commands: To open the Cypress UI:

npx cypress open To run tests in headless mode:

npx cypress run By moving the extracted Cypress folder to the correct directory, Cypress will function properly, avoiding the installation issues commonly seen with ARM-based systems like Windows 11 Surface Laptops.

AdnanVanni avatar Dec 26 '24 07:12 AdnanVanni

  • https://github.com/github/roadmap/issues/1098 is showing planning for Q2 2025 which would give a platform for testing on GitHub.

I haven't seen anything from CircleCI on this subject.

MikeMcC399 avatar Feb 04 '25 12:02 MikeMcC399

I also request that Cypress support arm64. I'm using the new Surface Pro 11 with Snapdragon X-Elite, and node.js works flawlessly on the device.

SoftwareDesign-Solution avatar Apr 05 '25 11:04 SoftwareDesign-Solution

GitHub announced Windows arm64 hosted runners now available in public preview on Apr 14, 2025. Public preview means beta quality. If this becomes stable it may allow testing Cypress against the WoA (Windows on Arm) architecture.

Still no sign of movement at CircleCI for WoA. They also have not responded to the question about supporting Windows 2025 either.

MikeMcC399 avatar Apr 15 '25 13:04 MikeMcC399

I was able to run a Cypress test in Chrome against the repo https://github.com/cypress-io/cypress-example-kitchensink in the GitHub Action runner windows-11-arm with a one-line patch to Cypress

https://github.com/cypress-io/cypress/blob/f62a65fe82c15faff5214a3cae52cd7bba58318b/cli/lib/tasks/install.js#L139-L143

adding win32-arm64 to allow the architecture.

Also using the environment variables:

  CYPRESS_DOWNLOAD_PATH_TEMPLATE: '${endpoint}/win32-x64/cypress.zip'
  CYPRESS_CACHE_FOLDER: $HOME/.cache/Cypress

and separating the patched dependency installation from the Cypress binary install.

At this time, this just shows a proof of concept. It doesn't mean that it is supported. There is not yet a production quality CI environment available to test Cypress with Windows on Arm (WoA). Also the Cypress.io team would need to consider adding it to the Cypress roadmap as well.

Node.js 20 is the minimum version required.

Edit: Node.js 18 doesn't support WoA, however this version ~~enters~~ is now in end of life ~~at the end of April 2025~~ in any case.

Edit: the Windows 11 arm image in beta on GitHub is currently based on the older Windows 11 23H2 edition and ships with older browsers, making it currently unsuitable for anything apart from beta testing.

MikeMcC399 avatar Apr 15 '25 17:04 MikeMcC399

Other preview users and I have submitted several issues in https://github.com/actions/partner-runner-images/issues regarding the windows-11-arm runner image and we're waiting for feedback.

MikeMcC399 avatar Apr 25 '25 07:04 MikeMcC399

Same here, Surface Pro 11. Fails ton install on arm64

danbord avatar Apr 28 '25 16:04 danbord

there was a patch wich would allow cypress to install: https://github.com/cypress-io/cypress/pull/30370

@jennifer-shehane why was this closed? how should I use patch-package?

My problem is, that our normal installation workflow of our build does not work. Why was the Ticket closed? This would not hurt the normal workflow. If anyone set this env var, he knows what hes doing.

jogibear9988 avatar May 23 '25 05:05 jogibear9988

@jogibear9988

how should I use patch-package?

The Cypress documentation https://docs.cypress.io/app/references/troubleshooting#Patch-Cypress describes how to use patch-package and in https://github.com/cypress-io/cypress/issues/30252#issuecomment-2806985437 I gave an example of a patch.

Unfortunately there has been no progress from the GitHub partners regarding issues with the windows-11-arm image and so there is still no production-quality CI test environment available for WoA. It seems like it's a low priority for them.

MikeMcC399 avatar May 23 '25 07:05 MikeMcC399

But why prevents this a patch from beeing merged?

jogibear9988 avatar May 23 '25 08:05 jogibear9988

I still believe my PR https://github.com/cypress-io/cypress/pull/30370#issuecomment-2903806367 helps users, not maintainers. I don't think maintainers should add patch-package to their package and complicate the configuration.

saschanaz avatar May 23 '25 09:05 saschanaz

  • I have submitted https://github.com/cypress-io/cypress/pull/31784 for consideration by the Cypress.io team to provide a way forward in resolving this issue.

  • In the PR, if the Cypress download module detects that it is running on Windows on Arm (win32-arm64) it downloads a win32-x64 Cypress binary image instead. All other functions and related environment variables work as before.

  • The change also allows win32-arm64 to be accepted as a platform and prevents a related error message and installation failure.

  • There are still no production-quality Windows 11 Arm runners available, neither on CircleCI, nor on GitHub. It is however possible to test on GitHub with the beta runner windows-11-arm which is running Windows 11 Enterprise 23H2. This allows testing of the installation process, however Windows 11 24H2 includes the new Prism emulation and this means that GitHub is not providing any way to test this emulation right now.

  • The documentation change suggestion in https://github.com/cypress-io/cypress-documentation/pull/6193 marks the Windows 11 24H2 platform as "preview stage" for this reason.

MikeMcC399 avatar May 24 '25 17:05 MikeMcC399

This issue has been automatically closed because the PR https://github.com/cypress-io/cypress/pull/31784 to allow installing Cypress on Windows Arm-based PCs has now been merged. I would expect it to be part of the next official Cypress 14.x release.

If you have already installed Cypress on a Windows Arm PC using a workaround or you plan to do it once official support is announced, please reply here with your details:

  • Status: Installed / Waiting for official support
  • Windows version: for example "Windows 11 24H2"
  • Processor: for example "Snapdragon X" (Windows Settings > System > Processor)

Note that this issue will be automatically locked after the release, so the request is only valid for a short period of time.

MikeMcC399 avatar Jun 06 '25 08:06 MikeMcC399

  • Status: Installed, by forking and creating tarball for npm package... https://github.com/saschanaz/cypress/releases/tag/v13.3.0-arch, #30366
  • Windows version: Windows 11 24H2
  • Processor: Snapdragon X 12-Core X1E80100

saschanaz avatar Jun 06 '25 13:06 saschanaz

@saschanaz

Thanks for your status! I see you are using Cypress 13.3.0 from Sept 2023. I would not expect this change to be backported to earlier versions. If you need to update to Cypress 14.x in the future, it should be easier for you.

MikeMcC399 avatar Jun 06 '25 17:06 MikeMcC399

A pre-release version is available for testing on Windows 11 24H2 Arm:

npm install https://cdn.cypress.io/beta/npm/14.5.0/win32-x64/develop-4450d3be74d72f61169a117bbc0bffef8d1d58fa/cypress.tgz

MikeMcC399 avatar Jun 06 '25 19:06 MikeMcC399