9

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
    Commented Jun 26, 2021 at 16:50
  • yes. It is a fresh installation. Commented Jun 26, 2021 at 19:40
  • Maybe upgrade software to latest. Current latest version is macOS Monterey (12.1)
    – compski
    Commented Jan 20, 2022 at 3:52

2 Answers 2

15

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

4

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .