function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
CRM_PeteCRM_Pete 

sfdx.cmd is not recognized as an internal or external command

When I try to run sfdx the same way I have for about 4 years, I get this error message:

'"C:\Users\Desja\AppData\Local\sfdx\client\bin\..\7.209.6-8ba3197\bin\sfdx.cmd"' is not recognized as an internal or external command, operable program or batch file.

>>> Why is it trying to run sfdx from that folder? It's not in that folder!

In this folder: C:\Users\Desja\AppData\Local\sfdx\client I have two sub-folders, "bin" and "7.209.6-8ba3197", the 2nd of which appears to have been created on 9/5/23 (just 2 days ago). The "bin" folder contains 2 files: sf.cmd and sfdx.cmd, while the "7.209.6-8ba3197" folder contains a "bin" folder, which contains a single file named "node.exe"

CLI has become a very valuable tool for me as I support 19 nearly identical orgs for the chapters of a national non-profit that works for the homeless. I have no idea why it has stopped working so mysteriously.

I have been through several existing messages on here that all seem to point to the PATH environment variable. The correct folder is present in my path, but the error message indicates it's trying to run sfdx from that other folder named 7.209.6-8ba3197\bin -- why?

Thank you for any clues to help resolve this.
Best Answer chosen by CRM_Pete
Chase Parker 4Chase Parker 4
Known issue. Upgrade or turn off autoupdate. 
https://github.com/forcedotcom/cli/issues/2447
 

All Answers

Shashwat TiwariShashwat Tiwari

Hi Pete. 
it seems sile you need to set path in your cmd. 

Open CMD and try: SET PATH=C:\Program Files\Java\jdk_version\bin and hit enter command.

Here Program Files\Java\jdk_version\bin can be your location of CLI

Else you can try cd.. or cd\ to back and forth in path. For this refer to the below link. 
https://www.wikihow.com/Go-Back-Using-the-Command-Prompt

Let me know if it gets resolved. 

Dave Pattison 24Dave Pattison 24
I have same issue as CRM_Pete only started happening yesterday
LI YONGLI YONG
I have same issue as CRM_Pete only started happening today ! 
in trouble!
i cannot be released
CRM_PeteCRM_Pete
@shashwat -- I tried that. Unfortunately, that was not the solution. Thank you for trying.

With two more people saying this is happening to them, seems this could be some kind of new bug.
LI YONGLI YONG

@CRM_Pete

Hi Pete
i am try it . reInstall the CLI , This issue has been solution。Command line execution is Succeed!
sf force:source:deploy -u [username] --manifest ./manifest/[package.xml]

Salesforce CLI is version up ! Move from sfdx (v7) to sf (v2)
Salesforce CLI Setup Guide
https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_move_to_sf_v2.htm
① uninstall sfdx (v7) 
② Install the CLI on Windows
https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm#sfdx_setup_install_cli_windows
③ install version confirm
      sf version
→ @salesforce/cli/2.7.11 win32-x64 node-v18.15.0
④ sfdx command is changed to sf ~
   no testclass command line run ↓
 sf force:source:deploy -u [username] --manifest ./manifest/[package.xml]
   testclass run command line run ↓
 sf force:source:deploy -u [username] --manifest ./manifest/[package.xml] -c -l RunSpecifiedTests -r ["testclass"]

LI YONGLI YONG
make up a complement
sfdx command and sf command line is all ok! 
sfdx force:source:deploy -u [username] --manifest ./manifest/[package.xml]
sfdx force:source:deploy -u [username] --manifest ./manifest/[package.xml] -c -l RunSpecifiedTests -r ["testclass"]
Chase Parker 4Chase Parker 4
I am having a similar issue. the VS code ext still works but anything using the SFDX command line is throwing this error as of the last few days. 
Chase Parker 4Chase Parker 4
I note the following in the log file at AppData\Local\sfdx which is when I started having the issue. this is just a snip. 
[2023-09-06T14:23:30.218Z] starting `C:\Users\XXXXXXX\AppData\Local\sfdx\client\bin\sfdx update --autoupdate` from C:\Users\XXXXXX\AppData\Local\sfdx\client\7.209.6-8ba3197\bin\run force:config:get
waiting until 2023-09-06T15:23:29.618Z to update

[G[1A[Jsfdx-cli: Updating CLI... already on version 7.209.6-8ba3197
sfdx-cli: Updating sf...
[G[1A[Jsfdx-cli: Updating sf... done
user plugins are 
NOTE: This error can be ignored in CI and may be silenced in the future
- Set the SFDX_HIDE_RELEASE_NOTES env var to "true" to skip this script

node:internal/modules/cjs/loader:1078
  throw err;
  ^

Error: Cannot find module './util/env'

 
Chase Parker 4Chase Parker 4
Known issue. Upgrade or turn off autoupdate. 
https://github.com/forcedotcom/cli/issues/2447
 
This was selected as the best answer
Dave Pattison 24Dave Pattison 24
Well, I am able to run sf commands, yes.
But Visual Studio Code stlll tries to run the sfdx version, so everything under the Command Palette is broken. 
VSCode "Check for Updates" says there are none available.
The installed Extension "Salesforce CLI Integration" is v58.14.2, as is "Salesforce Extension Pack". Which are current at the time of writing this.
CRM_PeteCRM_Pete
I ended up un-installing SFDX using this link:  https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_uninstall.htm

...and installed SF fresh. Fortunately, the connections to the 25+ orgs I had established access to were still there!  :)

The release I'm on is @salesforce/cli/2.7.11 win32-x64 node-v18.15.0  -- How do I know if future updates will be automatic?

Is there any way to receive an alert when an update is released?

Thanks to ALL for the friendly & helpful dialogue!
Chase Parker 4Chase Parker 4
The issue will continue no matter what with this old version. As the linked article describes you can either upgrade to V2 or turn off the autoupdate to stay on the old version and not have it delete itself.
https://github.com/forcedotcom/cli/issues/2447

 
wp encipherwp encipher
Really all the previously mentioned answers are 90% correct, just give them a try please let me know here, and we will also try to help. VITPRESS (https://vitpress.com)
Bryan Leaman 6Bryan Leaman 6
I had to re-install sf (aka sfdx) and then edit my system path environment variable to remove the obsolete sfdx/bin reference in favor of the sf/bin one.
Mike ArthurMike Arthur
Close VS Code
Rename C:\Users\xxx\AppData\Local\sfdx to C:\Users\xxx\AppData\Local\zsfdx
If it exists, rename C:\Users\xxx\AppData\Local\sf to C:\Users\xxx\AppData\Local\zsf
(Or just delete those folders if you prefer)
Follow the CLI installation link here:
https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm#sfdx_setup_install_cli_windows
Download and run the .exe
Start VS Code
CLI commands from command line should be working again.
(Mac install details are here: https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm#sfdx_setup_install_cli_macos)
Nachiket Kulkarni 8Nachiket Kulkarni 8
If nothing working for you. Just delete below directories(copy paste path in file explorer):
%LOCALAPPDATA%\sfdx
%LOCALAPPDATA%\sf
jerry smith 39jerry smith 39

Adding custom objects to an app after the initial creation of the objects is a common development task, especially when you want to extend the functionality of your application https://yasdownload.com/category/blog/. The specific steps and methods to achieve this can vary depending on the technology stack you're using, but here's a general guide to adding custom objects to an app: