This error appears in Visual Studio Code when you use the CTRL + SHIFT + P — SFDX: Create Project.
Sometimes, using VS Code results in a headache if you get an error like: Command ‘SFDX: Create Project’ resulted in an error command ‘sfdx.force.project.create’ not found.
Even if you have followed the tutorial to use VS Code with SFDX on Salesforce, you may encounter this type of problem.
Troubleshoot Command ‘SFDX: Create Project’ resulted in an error
This error is quite difficult to understand especially if you have a brand new install. If you get this type of error, first make sure that:
- Visual Studio Code is well installed
- SFDX is well installed: with the binary or with NodeJS
And if you have verified everything and everything is ok, go to the next chapter 😉
Check the Visual Studio Code logs
For this error, it’s hard to understand what’s going on, so we need to check some Visual Studio Code logs.
First, we can see that there is nothing in the Salesforce CLI output:
So, we need to open the developer tools.
Click on Help -> Toggle Developer Tools
This will open the DevTools on the right side. Check the logs in the console:
Here we can see that there are some errors: “extension ‘salesforce.salesforcedx-vscode-apex’ failed: EACCES: permission denied”
If I check the rights of the sfdx folder, I can see that the folder owner is not the good one, it’s root instead sylvain:
I just need to change the folder owner with a chown:
Restart the Visual Studio Code application and try again the SFDX: Create project and you can see that it’s now working like a charm 🙂