[SalesForce] SFDX: Deploy Source to Org : Error – SourcePathInvalid

I am Getting SourcePathInvalid for file path c://projectpath//projectname/extension-output-#2 at deployment time. Please refer attach image for more details.
enter image description here

Best Answer

This is happening because for the force:source:deploy command that path of the folder or the file you want to deploy is not correct.

Try opening up the file and doing a deploy or copy the file path or directory path by running pwd on your command terminal and manually type the command force:source:deploy --sourcepath "path of the directory or file"

Where path is the file path