6

Getting this below error with macOs Big Sur. Any help.

sfdx --version
/usr/local/bin/sfdx: line 44: /usr/local/lib/sfdx/bin/node: Bad CPU type in executable
3
  • Have you tried reinstalling SFDX yet?
    – Raul
    Jun 26, 2021 at 16:50
  • yes. It is a fresh installation. Jun 26, 2021 at 19:40
  • Maybe upgrade software to latest. Current latest version is macOS Monterey (12.1)
    – compski
    Jan 20 at 3:52

2 Answers 2

14

I'm going to assume you're on a newer Mac using the Apple M1 chip. There's already an open issue on the CLI github regarding this error.

It seems they're waiting for Nodejs to release a version that supports the M1 chip.

The workaround, for now, is to install Rosetta on your Mac. This

enables a Mac with Apple silicon to use apps built for a mac with an Intel processor.

The below command will help you install it

softwareupdate --install-rosetta

3

SFDX CLI ships with node 12 which does not support M1 chips.

Basically, you should just delete it and link a recent version of nodejs to its directory using the commands below (assuming you have nodejs installed by homebrew).

rm -f /usr/local/lib/sfdx/bin/node
link -s /opt/homebrew/bin/node /usr/local/lib/sfdx/bin/node

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.