2

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.

  • 2
    Sounds like SFDX is installed in a location that is not in your PATH. Are you using Git Bash/MinGW/Windows Subsystem for Linux, or cmd.exe? Have you tried to configure your PATH? – David Reed Nov 9 '18 at 20:55
  • If you open a command prompt and type echo %PATH%, what happens? (Looks like you're probably using cmd.exe) – David Reed Nov 9 '18 at 20:59
  • Actually that appears to be an excellent guess. It is stored in: c:\Program Files\Salesforce CLI\bin and that is not in the path. So I go to that subdirectory and try 'sfdx --version' and get 'sfdx-cli/6.38.0-0d66175ccf (windows-x64) node-v8.9.4'. So I guess it is installed. Added the sub-directory to the PATH and still no joy - same error. I try the project create manually by pasting the command into a CMD window and get 'Unexpected argument'. What a pain. – Dean Wooldridge Nov 9 '18 at 21:08
  • Put quotes around the --outputdir argument and got it to run. Still manually not from VS Code. – Dean Wooldridge Nov 9 '18 at 21:14
  • getting same issue mind you sfdx working in separate cmd prompt ,its only not working with VS code...i also added sfdx directory in PATH variable ![enter image description here](i.stack.imgur.com/53qOL.png) – Margaret real Dec 20 '18 at 1:42
3

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.
0

I could solve this issue by putting quotes around in the PATH environemnt variable values for Salesforce CLI and VS Code. So my PATH value for these 2 is currently : "C:\Program Files\Salesforce CLI\bin";"C:\Users\Consultant\AppData\Local\Programs\Microsoft VS Code\bin"; We need these quotes because both these 2 directory paths have spaces in their folder names

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.