What to do when I cannot start the oauth redirect server on port portinuseaction?

741    Asked by EllaClarkson in Salesforce , Asked on May 15, 2023

I am new in learning about lightning web components. I have installed VS Code, salesforce extension pack inside VS code, Salesforce CLI and set environment variable C:Program FilesSalesforce CLI in my system.

When I am trying to create a new project in VS Code, I am not able to authorise org. I am getting the below error.

Starting SFDX: Authorise an Org 23:45:43.364 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. 23:45:46.30 sfdx force:auth:web:login --setalias vscodeOrg --instanceurl https://login.salesforce.com --setdefaultusername ended with exit code 1
Answered by Dipika Agarwal
If you cannot start the oauth redirect server on port portinuseaction -

Run command prompt

Your Answer