Cannot read property 'getInstance' of undefined in Salesforce CLI while deploy and retrieve command

1k views Asked by At

VSCode is using for Salesforce development and couple of days back this issue is started whenever I am try to Deploy and retrieve changes from Org to my VScode Connected org. It is throwing Error Cannot read property 'getInstance' of undefined. Can anyone please help to resolve this.

2

There are 2 answers

0
Harshad Kumbhar On

I am able to resolve by uninstalling and reinstalling the Salesforce CLI from installed program on machine.

  1. Uninstall Salesforce CLI from installed program. Do not do it through VSCode.
  2. Download exe again from Salesforce https://developer.salesforce.com/tools/sfdxcli and install again.
0
Asif On

1- Uninstall Salesforce CLI

2- Go to windows explorer and use this path "%LOCALAPPDATA%\sfdx"

3- Delete all the files from there

4- Reinstall Salesforce CLI