I'm running the Trailhead tutorial at https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/create-a-hello-world-lightning-web-component?trail_id=build-lightning-web-components
I'm at the "Deploy to Your Trailhead Playground" and I'm getting an error. I right clicked on force-app\main\default folder and then selected "SFDX: Deploy Source to Org" per the instructions. I get the following error message:
Error deploying or retrieving source: The file or directory that you tried to deploy or retrieve isn't in a package directory that's specified in your sfdx-project.json file. Add this location to your "packageDirectories" value, or deploy or retrieve a different file or directory
Below is the content for my sfdx-project.json.
{
"packageDirectories": [
{
"path": "force-app",
"default": true
}
],
"name": "HelloWorldLightningWebComponent",
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "54.0"
}
Hi @John Tang ,
I was getting the same error on retrieving the components from org. So i went to the actual package.xml file on my vs code ide and right click > SFDX:Retreive Source in Manifest from org and it worked. Then you can try the SFDX: Deploy this source to Org
https://developer.salesforce.com/forums/?id=9062I000000IFKyQAO