I'm doing some Trailhead challenges that require me to download Salesforce CLI and SF Extension Pack on VSC. I've already downloaded both (as well as Java). I've added Java and SFDX to PATH yet I keep getting these errors:

12:34:39.435 sfdx force:auth:web:login --setalias code --instanceurl https://login.salesforce.com --setdefaultusername "sfdx" is not recognized as an internal or external command

12:34:39.996 sfdx force:auth:web:login --setalias code --instanceurl https://login.salesforce.com --setdefaultusername Salesforce CLI is not installed. Install it from https://developer.salesforce.com/tools/sfdxcli

Here's a snapshot of my Environment Variables: Environment Variables

System Variables

I've tried everything I've seen on forums (restarting the machine and so) but it isn't working for me.

  • Did you try to restart vs code after installing the CLI? Commented Sep 16, 2020 at 13:00
  • Yes I did! Still not working
    – eap99
    Commented Sep 17, 2020 at 8:06

1 Answer 1


OK I finally fixed it!! The '\bin' in C:\Program Files\Salesforce CLI in System Variable PATH was missing.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .