function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
javed786javed786 

salesforce DX : ERROR running force:mdapi:convert: This directory does not contain a valid Salesforce DX project.

Hello,
I am not able to convert the Metadata API Source after unzip the retrived source form Dev Hub

here is command 
sfdx force:mdapi:convert -r  /source directory 
Best Answer chosen by javed786
javed786javed786
I Got It...
Go to the go to the project directory and run the below command.
sfdx force:mdapi:convert -r mdapipackage/

All Answers

javed786javed786
I Got It...
Go to the go to the project directory and run the below command.
sfdx force:mdapi:convert -r mdapipackage/
This was selected as the best answer
Achod Goganian 1Achod Goganian 1
Thank you and please take my upvote, it worked :^)
Vinu M SankaralingamVinu M Sankaralingam

Mostly it occurs if the Project is not created properly.

So, again create a new project using below

>>sfdx force:project:create -n myproject
>>CD myproject 
then create a directory to retrieve the components from your org
>>mkdir temp
>>sfdx force:mdapi:retrieve -s -r ./temp -u mydevorg -p mypackage

then unzip the file and convert
>>sfdx force:mdapi:convert -r ./temp



 
Daniel RobertsDaniel Roberts
Hey guys, don't know if you are still willing to help, but I'm getting this error when I try to convert. Any ideas....

ERROR running force:mdapi:convert:  An error was encountered processing path: C:\Users\Drobe\OneDrive\Desktop\Projects\BearApp\temp\BearApp\lwc\helloWebComponent\helloWebComponent.html
 
Eugene Vabishchevich 8Eugene Vabishchevich 8

Hello, the same trouble. 

ERROR running force:mdapi:convert:  An error was encountered processing path: /Users/enway8/Documents/Salesforce/Converter/temp/lwc/headerTitleWithDescription/headerTitleWithDescription.html

Felix van Hove 16Felix van Hove 16
@Daniel, @Eugene, force:mdapi:convert does currently not work with Lightning Web Components. This is a Salesforce bug, they are working on it, see https://github.com/forcedotcom/cli/issues/31