[SalesForce] SFDX CLI runtime error

I'm getting the following error when trying to access the sfdx command. Does any one know what's happening?

The only words I actually understand are the "not a directory", but I'm not sure which one he's referring to either.

I tried re-installing the CLI, but it still persists.

17:16   Error running Salesforce DX:  ▸    stat /Users/hojasdemanzano/.local/share/sfdx/client/bin/sfdx: not a directorypanic: fork/exec /Users/hojasdemanzano/.local/share/sfdx/client/bin/sfdx: not a directorygoroutine 1 [running]:panic(0x258700, 0xc42000c180)    /usr/local/go/src/runtime/panic.go:500 +0x1a1main.must(0x3bd460, 0xc42000c180)  /Users/t.dvornik/Projects/heroku-cli/io.go:115 +0x5cmain.getExitCode(0x3bd460, 0xc42000c180, 0xc42000c180)  /Users/t.dvornik/Projects/heroku-cli/main.go:42 +0x12bmain.main()   /Users/t.dvornik/Projects/heroku-cli/main.go:28 +0x14c

Any help is appreciated 🙂

Best Answer

I eventually managed to make it run by deleting it and installing it again.

I deleted all the references to the CLI with the following commands:

sudo rm -rf /usr/local/sfdx
sudo rm -rf /usr/local/lib/sfdx
sudo rm -rf /usr/local/bin/sfdx
sudo rm -rf ~/.local/share/sfdx ~/.config/sfdx ~/.cache/sfdx
sudo rm -rf ~/Library/Caches/sfdx

And then simply installed it again.

I don't really know why it broke from one day to another, but it's the only approach that worked. I could not update it via CLI (obviously?) and re-installing it also didn't work. I needed to explicitly delete all the references as stated in the docs.

Related Topic