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
Herish SurendranHerish Surendran 

ERROR running force:auth:web:login: Cannot start the OAuth redirect server on port PortInUseAction.

i am trying to connect a dev hub in visual studio.

When I try to execute the command force:auth:web:login -d -a DevHub, I am getting an error 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.  
Best Answer chosen by Herish Surendran
Herish SurendranHerish Surendran
I uninstalled everything and reinstalled it. It then worked.
 

All Answers

Herish SurendranHerish Surendran
I even tried to kill the port 1717 via task manager, The one with PID 0 is what I tried to kill by clicking on end task

I tried killing it but that too didn't work.

Can anyone suggest what can be done
Herish SurendranHerish Surendran
I uninstalled everything and reinstalled it. It then worked.
 
This was selected as the best answer