[SalesForce] Issue with SFDX: Authorize an Org

I am trying to create a Hello World Lightning Web Component as mentioned in the URL below.
Hello World Lightning Web Component

But in VS code I am getting below output. I did some analysis but unable to resolve it. Please help me how can I proceed further.

VS code output:

Starting SFDX: Authorize an Org

09:42:18.175 sfdx force:auth:web:login --setalias vscodeOrg --instanceurl https://login.salesforce.com --setdefaultusername
ERROR running force:auth:web:login:  Cannot start the OAuth redirect server on port PortInUseAction. 

Try this: 
Kill the process running on port 1717 or use a custom connected app and update OauthLocalPort in the sfdx-project.json file.
09:42:23.367 sfdx force:auth:web:login --setalias vscodeOrg --instanceurl https://login.salesforce.com --setdefaultusername ended with exit code 1

Thanks in Advance 🙂

Best Answer

What you should do is stop Git service running in the background and authenticate your CLI with your devhub (the org you are using to create scratch orgs). Note somehere your devhub username and password and auth with this;

sfdx force:auth:web:login

After creating a scratch org and setting it as your default username, you can open with: sfdx force:org:open -u yourscratchorgusername

Related Topic