+ Start a Discussion

Visual studio code Salesforce cli integration not working

I have installed the Salesforce CLI package and it is working fine from the terminal window.
I have installed the Salesforce Extensions package into Visual Studio Code and all looks fine.
However when I enter Command-Shift-P and type something like SFDX: Create Package I get a notification to install the Salesforce CLI package.
All the sfdx commands work fine from with VS Code’s terminal window.

I am at a loss as to what is wrong. 
I am running on a Mac and all the help articles are for Windows are direct you towards missing or incorrect Path statements. Not much help for a Mac user.

I have tried completely removing the SFDX package (via rm statements from terminal) along with removing the Salesforce extensions from VSCode. After reinstalling all this - same problem.

Any ideas or help would be appreciated.
Alain CabonAlain Cabon
There is an alternative by installing the Salesforce CLI with NPM.

Install the CLI with npm (+ node): https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm

I prefer to use this technique even if a .exe (windows) or a package (mac) seems easier.
There are some problems afterwards (interferences with a preexisting node installation in different folders).

c:\>npm list -g --depth 0

C:\Users\<your user>\AppData\Roaming\npm    ( different on Mac surely )

+-- node@11.9.0
+-- npm@6.11.3
+-- sfdx-cli@7.23.1

( this command is very slow but it is a easy verification for the folder of the global modules installed with npm )
As far as I can see the Salesforce CLI is installed fine as it works from the Mac Terminal and from the terminal within Visual Studio Code. Just seems to be the Salesforce VS Code CLI plug-in/extension doesn’t find it. Stephen FinlayM: 0419 615 896W: https://about.me/StephenFinlay

I've tried uninstalling everything and starting from srcatch again - same result VSCode tells me that the Salesforce CLI is not installed when I try Cmd-Shift-P and select SFDX Create Project.
Installed under Windows - works fine as per the instructions in Trailhead.

Any Mac users out there actually get this to work?

saurabh shukla 17saurabh shukla 17
Did anyone find a solution to this even i am facing the same issue. I am not able to find the SFDX commands under the command palette when pressing Ctrl+Shift+P. But I can do everything through the terminal. It was working before and i completed the LWC superbadge last week using the same and due to some update in between this broke.

Could anyone please let me know what is the issue. Below is the error message:

Command 'SFDX: Create Project' resulted in an error (command 'sfdx.force.project.create' not found)

PS: I tried reinstalling everything from jdk, vscode, cli but no luck. Any help would be appreciated.
Sushiil ShettigarSushiil Shettigar
What ended up working for me was uninstalling the VS Code extensions, manually removing the leftover files (Terminal: rm -rf ~/.vscode/extensions), closing and reopening VS Code, and then reinstalling the extensions.
Pravudatta MohantyPravudatta Mohanty
in npm\node_modules\sfdx-cli\bin folder, rename run.cmd to sfdx.cmd

I had the same exact issue all day and it's incredibly frustrating. I'm not sure exactly which of these steps did the trick, but I have it working again for me on my Mac. I wish I had more specifics on the exact fix (for Mac), but after doing the following steps it started working again-

1) Re-install Salesforce CLI
2) Uninstall Salesforce Extension Pack from VS Code
3) Re-install Salesforce Extension Pack
4) Completely close the VS Code application
5) Re-open VS Code, and then re-open your root project folder (even if it's already opened)

I'm guessing doing all of the above reset all of the system files and config settings to make it work again. I spent hours today trying to figure this out and found nothing concrete online, but hopefully this helps save a little time for anybody else dealing with this issue.

Kalu Saini 5Kalu Saini 5
I also faced same issue and tried for many time for resolving the problem and after all i got the solution sharing below:-
  1. Uninstall the Current CLI.
  2. Uninstall the Salesforce Extension Pack from VS code.
  3. Restart system.
  4. Download and intall the Salesforce CLI from given Link : https://trailhead.salesforce.com/en/content/learn/projects/quickstart-vscode-salesforce/vscode-salesforce-ready
  5. After installing the CLI please restart the system.
  6. Now open VS code and re-install the Salesforce Extension Pack for VS Code.
  7. Close the VS code and Restart the system.
  8. And after system start try open VS code it will work fine.
It worked for me and I did it for Windows10 based system and i have 64bit windows OS configuration so please choose the correct version of cli from given link.
Raghavendran KrishnamurthyRaghavendran Krishnamurthy

I faced this problem

I am not sure about the actual cause of this - but I was able to get it working by creating a new SFDX project and then copying & Pasting those LWC components into the new project.