This error is occurring after setting a new default scratch org in a salesforce-cli project directory, and trying to open the org browser in VSCode. I get the above message. When I try the suggested command, I get a pop-up with
Command 'SFDX: Authorize an Org' resulted in an error
CLI Command process failed to start
The same thing happens with a dev org.
If I try
sf org login web
using the password that I set after the scratch org was created, the login fails. (The login attempt is directed to login.salesforce.com.)
What makes this more infuriating is that I have a second VSCode window open in another project, and the org browser shows me the contents of the scratch org and the dev org.
This is a good way to go nuts.
The key seems to have been, for me, in the mode of installation. As you will be aware, the documentation offers a number of paths to installing salesforce-cli. I'm on a mac, and I had a homebrew installation of node and npm, so I installed manually using npm.
Almost all of the advice on problems of this kind centers on reinstalling or upgrading salesforce-cli or VS Code, but one commentator suggested settling on an LTS version of node, so I downgraded to node 20.15.0 in homebrew. I uninstalled and re-installed sf-cli more than once, but problems remained.
My latest attempt, currently successful, was to uninstall salesforce packages manually, and install MacOS ARM version from Salesforce, here. I also restarted VS Code to update any pending extensions.
Now things are working.
But this is like – I originally used a word that refers to certain rites in Haiti, but my post was rejected because of the language, so I will just say – magic. The question is WHY does this happen, and happen so frequently. It is enormously frustrating to large numbers of potential and actual developers, and nobody seem to know why. I say that because if anyone did know why this happened, surely the problem would be fixed, or at least documented so that a fix could be worked on.