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
EdCodeEdCode 

'sfdx' is not recognized as an internal or external command, operable program or batch file.

When keying sfdx from cmd or from the VS Code Terminal, I am getting the error: 'sfdx' is not recognized as an internal or external command, operable program or batch file.

Any clue on how to fix this?
 
Best Answer chosen by EdCode
EdCodeEdCode
Thank you.

At the end, I found the problem:

upon installing Salesforce CLI, the process created an Environment Variable with the name "Salesforce CLI".

By reviewing the screen shots here (https://salesforce.stackexchange.com/questions/163795/sfdx-is-not-recognized-as-an-internal-or-external-command) (provided above by Raj Vakati), I have observed that the Environment variable refered to Salesforce CLI was named "Path". I have therefore tried renaming the Environment variable to "Path" and.... guess what... IT WORKED!

Thank you both, Raj Vakati and Greg Finzer)

 

All Answers

Raj VakatiRaj Vakati
How you install the SFDX 

Refer this link 

https://salesforce.stackexchange.com/questions/163795/sfdx-is-not-recognized-as-an-internal-or-external-command

 
Greg FinzerGreg Finzer
Also, Java is a pre-requisite as well.  

See my detailed instructions on how to setup VS Code for Salesforce:
http://sixfootcoder.blogspot.com/2019/01/setting-up-vs-code-with-salesforce.html
 
EdCodeEdCode
Thank you.

At the end, I found the problem:

upon installing Salesforce CLI, the process created an Environment Variable with the name "Salesforce CLI".

By reviewing the screen shots here (https://salesforce.stackexchange.com/questions/163795/sfdx-is-not-recognized-as-an-internal-or-external-command) (provided above by Raj Vakati), I have observed that the Environment variable refered to Salesforce CLI was named "Path". I have therefore tried renaming the Environment variable to "Path" and.... guess what... IT WORKED!

Thank you both, Raj Vakati and Greg Finzer)

 
This was selected as the best answer
Abirami K 9Abirami K 9
sharing how it got sorted for me.
'sfdx' command in command prompt(run as admin) threw error - sfdx is not recognized.
I had multiple Salesforce CLI installed on my system.from my Salesforce CLI, sfdx folder in sytem, ran the uninstall file.

then installed the Salesforce CLI- https://developer.salesforce.com/tools/sfdxcli# (https://developer.salesforce.com/tools/sfdxcli#). Issue got fixed. Hope it helps somebody.
divyana goswamidivyana goswami
Use "https://developer.salesforce.com/tools/sfdxcli" to install CLI, it will resolve the issue.
rohit goel 9rohit goel 9

Below command solves my issue

npm install sfdx-cli --global -force