-1

"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. For details about sfdx-project.json, see: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm" I am using Salesforce CLI extension version v58.9.1

I am trying to deploy a class using right click and deploy to org option but i encounter error

1 Answer 1

0

Open sfdx-project.json and add your current package path to the package directory as below: the relative path name should be the package directory where all package components exist.

{
     "packageDirectories": [
      {
         "path": "force-app",    
         "default": true    
      },
      {
         "path": "relative path name of package directory",
      }

   ],
   "namespace": " ",
   "sfdcLoginUrl": "https://login.salesforce.com",
   "sourceApiVersion": "58.0"
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.