GoogleChromeLabs / chrome-for-testing

https://googlechromelabs.github.io/chrome-for-testing/
Apache License 2.0
704 stars 83 forks source link

Chrome Testing App does not work on Apple M1? #98

Closed nishantkp closed 9 months ago

nishantkp commented 10 months ago

Hello,

I have an M1 Mac Pro.

Tried to install Chrome 113 with,

npx @puppeteer/browsers install chrome@113

After it was installed, I tried to open it, it gave the following message,

You can’t open the application “Google Chrome for Testing.app” because this application is not supported on this Mac.

I tried xattr command but it didn't do anything and gave the same message as above.

xattr -cr `PATH to *.app`

Not sure entirely but could M1 has anything to do with it? If not then how would I resolve this?

OrKoN commented 10 months ago

It might be that your Node runs in x64 emulation mode instead of arm64. What does require('os').arch() report? Expected: arm64.

nishantkp commented 10 months ago

@OrKoN Yeah, you are right, its x64

Welcome to Node.js v21.5.0.
Type ".help" for more information.
> require('os').arch()
'x64'

How can I change it to arm64?

OrKoN commented 9 months ago

I guess you are running a Node x64 binary somehow. I am not sure how to fix it but you can force a custom platform

npx @puppeteer/browsers install chrome@113 --platform mac_arm
nishantkp commented 9 months ago

@OrKoN thanks so much!

I have to fix this Node x64 but your platform-specific solution works.

and one more question, how can I get Chrome 112 and lower with npx @puppeteer/browsers install? Every time I try to do that, I get an error.

OrKoN commented 9 months ago

See https://github.com/GoogleChromeLabs/chrome-for-testing?tab=readme-ov-file#json-api-endpoints for minimally supported versions.