question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Authorize An Org failed because force:auth:web:login is not a sfdx command

See original GitHub issue

Summary

When I was following the instruction in this tutorial: https://trailhead.salesforce.com/content/learn/projects/quickstart-vscode-salesforce/use-vscode-for-salesforce, the Authenticate to Your Playground step failed. And in the output console I saw

Starting SFDX: Authorize an Org

15:23:41.710 sfdx force:auth:web:login --setalias VSCodePlayground --instanceurl https://login.salesforce.com --setdefaultusername
 ›   Warning: force:auth:web:login is not a sfdx command.
Did you mean auth:web:login? [y/n]: 
 ›   Error: Run sfdx help force for a list of available commands.
15:23:47.396 sfdx force:auth:web:login --setalias VSCodePlayground --instanceurl https://login.salesforce.com --setdefaultusername
 ended with exit code 127

I believe it’s caused by the new version sfdx cli deprecates the force versions of these commands

Steps To Reproduce:

  1. Install the latest sfdx cli
  2. Install the Salesforce Extension in VSCode
  3. Run SFDX: Authorize an Org in VSCode

Expected result

The org is authorized successfully

Actual result

authorization failed with the error Run sfdx help force for a list of available commands.

Additional information

image

VS Code Version: Version: 1.51.1

SFDX CLI Version: sfdx-cli/7.83.0-eba9c6a927 darwin-x64 node-v12.18.3

OS and version: v50.13.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

30reactions
4388331commented, Jan 16, 2021

I resolved the same issue with the plugin Run this in CMD “sfdx plugin:install @salesforce/plugin-auth@1.4.3”

Got solution here https://github.com/forcedotcom/cli/issues/757#issuecomment-741885504

16reactions
KuljitSinghTomarcommented, Jan 18, 2021

Running sfdx update on my mac terminal fixed this issue for me. Thank you @4388331 for the pointer!

Read more comments on GitHub >

github_iconTop Results From Across the Web

SFDX: Authorize an Org failed to run - Salesforce Developers
Hi guys, 1.Press Ctrl+Alt+Delete, then click Task Manager. 2.Select the Process tab. 3.Find the process named Node. 4.Select the process that ...
Read more >
Authorize An Org failed because force:auth:web:login is not a ...
Authorize An Org failed because force:auth:web:login is not a sfdx command. While setting up VS code for LWC there are many steps to...
Read more >
SFDX: Authorize an Org failed to run in VSCODE
I am tring to authorize an org on visual studio code but when I am trying authorize it, I am getting the below...
Read more >
SFDX Authorize an Org failed to run - Stack Overflow
After re-installing Salesforce CLI and running the command sfdx from the Terminal window, I am still getting this error: "/Users/eduardo/.local/ ...
Read more >
VS Code Authorize an Org Archives - Salesforce Tips - Greytrix
In this blog we will discuss how to resolve the Authorization error while executing SFDX command “Authorize an Org” in VS Code. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found