function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ankethaanketha 

Unable to create a Lightning web Component

When I'm trying to follow the trailhead to create Lightning web component, I'm stuck at step 2.

In the 1st course, we have to install Salesforce CLI and VS Studio tools which is done.

In the 2nd course, where a new project has to be added is also done. But after that, when I try to Authorize an org or setup a default org, it gives me the below error:

Starting SFDX: Authorize an Org
16:19:16.79 sfdx force:auth:web:login --setalias MyDevOrg --instanceurl https://test.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 7717 or use a custom connected app and update OauthLocalPort in the sfdx-project.json file.
16:21:02.884 sfdx force:auth:web:login --setalias MyDevOrg --instanceurl https://test.salesforce.com --setdefaultusername ended with exit code 1

I have tried to  search the process with the port number - 7717 and tried to kill that process, but that doesn't work either.

Any help on this will be appreciated.

Thanks!
Khan AnasKhan Anas (Salesforce Developers) 
Hi Anketha,

Greetings to you!

Try restarting your computer.

Please refer to the below links which might help you further with the above issue.

https://salesforce.stackexchange.com/questions/256860/authorize-org-failed-in-vs-code

https://developer.salesforce.com/forums/?id=9062I000000IEvoQAG

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
SAKTHIVEL MSAKTHIVEL M

same issue to me, even i tried all https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_troubleshoot_cancel_auth.htm

then not worked for me, so i reinstalled the vsc and installed the plugin and its worked perfectly. but not sure this as the solution, but worth to retry to install and check it.

Thanks