You need to sign in to do that
Don't have an account?
EdCode
Have installed Salesforce CLI before Visual Studio Code + Salesforce Extensions
Hello,
I am trying to learn about SFDX and have installed Visual Studio Code + Salesforce Extensions.
I skiped the step that says "Make sure you have the latest version of the Salesforce CLI installed, and that your system meets the necessary requirements." because, before installing VS Code + the SF Extensions, I reviewed the list of extensions includeded in SF Extensions and saw that it included CLI.
It was a confusion moment and... I think I also read out there that it was better to installed CLI as part of SF Extension (which includes a set of extensions).
Eventually, because I was not able to create new Project from VS Code (Ctrl+Shift+P), I decided to revisite the steps to set up SF DX with VS Code, and decided to intall SF CLI by downloading a file (win64) from here (https://developer.salesforce.com/tools/sfdxcli ) and execute installation of that file.
Right now, my laptop has the following installed:
- Visual Studio Code + Salesforce Extensions (look at screenshot below)
- Salesforce CLI (win64) dowloaded from the above link
How can I verify if Salesforce CLI works fine? I have tried executing cmd.exe the following command: sfdx --version
... but I am getting this error message:
Do you think that the fact that I installed SF CLI after installing VS Code is the reason for the above command line not being recognized?
How can I make sure that I have all the SFDX tools correctly installed?
Thank you very much.
I am trying to learn about SFDX and have installed Visual Studio Code + Salesforce Extensions.
I skiped the step that says "Make sure you have the latest version of the Salesforce CLI installed, and that your system meets the necessary requirements." because, before installing VS Code + the SF Extensions, I reviewed the list of extensions includeded in SF Extensions and saw that it included CLI.
It was a confusion moment and... I think I also read out there that it was better to installed CLI as part of SF Extension (which includes a set of extensions).
Eventually, because I was not able to create new Project from VS Code (Ctrl+Shift+P), I decided to revisite the steps to set up SF DX with VS Code, and decided to intall SF CLI by downloading a file (win64) from here (https://developer.salesforce.com/tools/sfdxcli ) and execute installation of that file.
Right now, my laptop has the following installed:
- Visual Studio Code + Salesforce Extensions (look at screenshot below)
- Salesforce CLI (win64) dowloaded from the above link
How can I verify if Salesforce CLI works fine? I have tried executing cmd.exe the following command: sfdx --version
... but I am getting this error message:
Do you think that the fact that I installed SF CLI after installing VS Code is the reason for the above command line not being recognized?
How can I make sure that I have all the SFDX tools correctly installed?
Thank you very much.
All Answers
The command "sfdx --version" is the correct one to verify that.
I can re-install the CLI but that is the last thing I have done.
After re-installing the CLI, should I also re-install the Salesforce Extensions in VS Code?
Thank you very much
(instead of C:\Program Files)
Perhaps this was the reason. I will let you know if it works after the re-install process is finished.
Thank you.
Any other idea?
Thank you very much.
Please refer to the below link.
https://salesforce.stackexchange.com/questions/167120/sfdx-command-not-found-salesforce-dx/191974
Copy the Path "C:\Program Files\sfdx\bin" and paste it into System Environment Variable. Also, you can check if there is an executable at that location. If that is the case then just adding the bin path should actually work.
Thank you. I think your advice to add a path on the System Environment Variables of Windows is probably the correct direction to resolve the issue.
However, I observe that this path (C:\Program Files\sfdx\bin) does not really exist as such in my laptop. Instead I have these 2 existing paths now:
C:\Program Files\Salesforce CLI\bin
C:\Program Files (x86)\Salesforce CLI\bin
That is because I installed twice Salesforce CLI, one in each subdirectory (to try if that was the issue) but, I am not sure why your URL includes the folder "sfdx" while my URLs include the folder "Salesforce CLI" instead (?)
Anyways, I have added your suggested path to Windows' System Environment Variables --> it did not work.
Then, I have tried C:\Program Files\Salesforce CLI\bin --> it does not work.
And then, C:\Program Files (x86)\Salesforce CLI\bin --> it does not work either.
Any idea of what the issue could be?
Thank you very much.
I think it is just the folder name. I have the below location in the path:
C:\Program Files\Salesforce CLI\bin
This works for me. You can try the following
- Uninstall the sfdx from Program Files (x86) location
- Try adding the path "C:\Program Files\Salesforce CLI\bin" to the User Variables and not the System Variables.
This should probably work. I have the same configuration.Regards,
Ankush
I have tried exactly what you have suggested:
- Uninstalling the CLI from Program Files (x86) location;
- I have added the path C:\Program Files\Salesforce CLI\ to the "User Variables" (not the system variables);
But, that is not resolving it.In order to do the above 2 steps, I have had to log as a System Admin of Windows 10 (this is a laptop of a company).
Then, I have tried from that System Admin user AND from my regular user to execute the command "sfdx --version" from cmd and it just returned the same error (sfdc is not recognized....)
I wonder if, when adding the additional path to the User Variable, I may have to specify the User name I want this to work with (?) I do not now how to specify the User on this path C:\Program Files\Salesforce CLI\
I am continuing to investigate as I have not been able to solve it so far.
Thank you very much.
With my regular user (the non-System Admin), I have now been able to verify that the path C:\Program Files\Salesforce CLI\bin is added/visible on the list of User Variables.
I have rebooted my machine and have logged again with my regular user and tried again the command in cmd:
So, I am not sure what else to try now.
Any idea?
I had the same problem and found the solution. Salesforce CLI creates a User Variable when installed but Windows 10 does not allow spaces in the PATH which makes it fail to work. to fix I copied the whole file over to another Directory called Tools and renamed the file "Salesforce CLI" to remove the space > "SalesforceCLI". then added a new PATH looking at this new Directory C:\Tools\SalesforceCLI\bin which allowed the cmd to be global.
All credit goes to this post:
https://salesforce.stackexchange.com/questions/221950/salesforce-cli-tools-do-not-work-together-with-git-bash-on-windows
I just had to rename the name of the Environment variable to Path (replacing the name that was created automatically when installing Salesforce CLI).
I now works perfectly.