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 :-)

  • Run a sfdx update !! Jan 13, 2018 at 16:40
  • @MohithShrivastava I can't update it if I can't access the command. I did try downloading the newest .pkg and installing it tho. Jan 13, 2018 at 16:46
  • Did you do an update to OSX, by chance, recently?
    – pchittum
    Jan 15, 2018 at 1:30
  • @pchittum I have done several updates this week, I'm not sure at which point it broke or if it was the cause though. Jan 15, 2018 at 8:54
  • Sure. I was curious because this is typical of the breakage that happened when people upgraded to High Sierra (or upgrading OSX versions in general).
    – pchittum
    Jan 19, 2018 at 9:24

1 Answer 1


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.


You must log in to answer this question.

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