I'm trying to deploy my objects from VS Code to Prod. All my object is in Source format. But when I try to deploy, I get below error :

sf:INVALID_OPERATION: INVALID_OPERATION: testLevel of NoTestRun cannot be used in production organizations

And if I give RunLocalTest command it gives below error:

ERROR running force:source:deploy: ERROR: This command doesn't support wildcards. Remove the wildcard, and run the command again. See --help for examples.

Here is my command which I'm trying to run for Prod deployment

sfdx force:source:deploy --sourcepath /Users/salesforceDeveloper/Desktop/SFDC Project/Prod Migration/force-app/main/default/objects -l RunLocalTests -u TargetEnv

Also is there any command using which I can only validate my component in Prod?


  • instead of -l RunLocalTests, try RunAllTests option
    – Remario
    Apr 22, 2020 at 0:23

1 Answer 1


You have a space in your file path, so the CLI thinks you're trying to add multiple paths. Make sure you either quote:

"/Users/salesforceDeveloper/Desktop/SFDC Project/Prod Migration/force-app/main/default/objects"

Or backslash escape:

/Users/salesforceDeveloper/Desktop/SFDC\ Project/Prod\ Migration/force-app/main/default/objects

Or ideally, move the folder to a place without spaces. They tend to cause problems wherever you go. I recommend something like /workspace/salesforce/migration or something like that.

To verify only, use -c as a parameter:

sfdx force:source:deploy -p force-app/ -c -w 100 -l RunLocalTests -u targetOrg

I also recommend a wait time (-w 100) so that you can get feedback when the deployment is finished. If you don't use this parameter, you need to run force:source:deploy:report later, which is usually just annoying.

  • Okay so just to validate my components I have to use -c Apr 22, 2020 at 10:00
  • Now instead of using whole path, I'm running the command from project folder Apr 22, 2020 at 10:01

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.