2

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 :)

3

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

  • 1
    Thank you for your response. – raviteja Jan 10 at 8:07
  • when I ran sfdx force:org:list --all it is returning Dev Hab alias Name along with UserName,OrgID and connected Status. Below this I am getting No active scratch orgs found. Specify --all to see all scratch orgs. How to create scratch ORG. – raviteja Jan 10 at 8:10
  • @raviteja sfdx force:org:create -s -f config/project-scratch-def.json -a ProjectName sets up a scratch org [ -s default org for this project, -f path to config file, -a assign alias] – Atlas Can Jan 10 at 12:31
  • 1
    Just FYI, OP could also change the port being used by SFDX by setting the "oauthLocalPort" attribute on the sfdx-project.json file. Source: salesforce.stackexchange.com/questions/226114/… – Renato Oliveira Jan 10 at 13:01
  • Thank you for the suggestion @RenatoOliveira. – Atlas Can Jan 10 at 13:10
2

The Error indicates Git service is running in background. You need to stop the running process to perform other commands.

Steps to Kill the Running process

1) Open the Command Promt.

2) Type the below line. Replace <yourPortNumber> with your port. In your case its 1717

netstat -ano | findstr :<yourPortNumber>

You will get below result enter image description here

3) Execute Below command. Replace <typeyourPIDhere> with your PID as shown in red circle. Here its 3740.

taskkill /PID <typeyourPIDhere> /F

4) You will get success Message 'The Process with PID 3740 has been terminated'

5) Then you can run your SFDX Commands.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.