[SalesForce] Salesforce CLI is not installed – it ain’t so

In VS Code. Go to command palette and enter 'Create Project with Manifest'. Prompted for a folder and get these messages:

Starting SFDX: Create Project

sfdx force:project:create –projectname DeanSand –outputdir c:\Users\dean.wooldridge\Documents\Salesforce\Dean Notes\VSCode\DeanSand –manifest

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

sfdx force:project:create –projectname DeanSand –outputdir c:\Users\dean.wooldridge\Documents\Salesforce\Dean Notes\VSCode\DeanSand –manifest

ended with error spawn sfdx ENOENT
The Salesforce CLI is not installed. Install it from https://developer.salesforce.com/tools/sfdxcli

I promise it is installed – did it yesterday and had to have IT come over and temporarily grant admin access to do it.

Best Answer

There appear to be two separate issues here:

  1. SFDX must be in your PATH environment variable. That is, the full path of the bin subdirectory where the sfdx executable lives. You'll likely need to relaunch your terminal and/or Visual Studio Code to get them to observe any changes you've made to your Windows PATH.
  2. You need to quote any file and directory path names that contain spaces when you're manually invoking SFDX (or any other command line tools) in the shell. Note that some tools don't handle spaces well anyway - you may head off issues with other software if you try to avoid spaces in your paths.
Related Topic