question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support installation on Mac M1 ARM (using rosetta2)

See original GitHub issue

I’m trying to install PACT for testing, I get the following error:

arch -x86_64 npm install @pact-foundation/pact-node
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for @pact-foundation/pact-node@10.11.8: wanted {"os":"darwin,linux,win32","arch":"x64,ia32"} (current: {"os":"darwin","arch":"arm64"})
npm ERR! notsup Valid OS:    darwin,linux,win32
npm ERR! notsup Valid Arch:  x64,ia32
npm ERR! notsup Actual OS:   darwin
npm ERR! notsup Actual Arch: arm64

I have tried with node 12 and node 15. / I have tried to specify arch x86_64 to run on rosseta2, but I think the issue is the call to the binary form js, would need to specify that flag if the architecture is darwin / arm64 pass the arch flag when calling the binary file to run it through rosetta2.

Any other workarounds that you suggest?

Thanks, Pedro

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:25 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
lawrenceongcommented, Mar 9, 2022

@iknowcss We are using Apple M1 as well. We usually run pact locally, either manually or on commit. To workaround the following error when building via docker:

Error: Error while installing binary: Cannot find binary for platform 'linux' with architecture 'arm64'.

We added the following to Dockerfile:

# Skipping pact binary install as it is not compatible with Apple M1 CPU
# See: https://github.com/pact-foundation/pact-js-core/issues/347
ENV PACT_SKIP_BINARY_INSTALL true

Can probably make it more comprehensive by detecting for CPU before setting it. Hope that helps.

3reactions
johanneswuerbachcommented, Aug 3, 2021

This should no longer be required since pact-node@10.13.1 / pact-core@11.1.0 as the cpu limitation was removed https://github.com/pact-foundation/pact-js-core/pull/302

Now pact should just work ™️ with an arm node and rosetta installed 🎉. Thanks @TimothyJones

Read more comments on GitHub >

github_iconTop Results From Across the Web

If you need to install Rosetta on your Mac - Apple Support
Rosetta 2 is available only for Mac computers with Apple silicon. You're asked to install Rosetta the first time you open an app...
Read more >
How to Install Rosetta 2 on Apple Silicon Macs - OSXDaily
There are two ways to install Rosetta 2 onto an Apple Silicon Mac; using the Terminal, or by attempting to open a non-native...
Read more >
install Rosetta 2 on M1 Mac to run Intel-only Apps
This post tells how to install Rosetta 2 on Mac shipped with M1, M1 Pro, and M1 Max chips to run Intel apps...
Read more >
How To Install Rosetta 2 On M1 Mac (Run Intel ... - YouTube
How To Install Rosetta 2 On M1 Mac (Run Intel Apps on Apple Silicon ARM ) ... video on how to install Rosetta...
Read more >
Rosetta 2 On Linux VM - Install Ubuntu On M1 Mac ... - YouTube
Install ubuntu 22.04 On VM On M1 Mac Running MacOS 13 Ventura and Run Intel / x86_64 Apps On ARM Linux With Rosetta...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found