I faced the following error today when logging in Salesforce Dev Hub using the CLI.
'EACCES': listen EACCES 127.0.0.1:1717
And what I did to get over it was to change that default port 1717 to something else.
The steps are as below.
- Open a
Command Prompt
window. - Go to a folder in your local machine using
cd
command. For example, in my case:cd Samples\Salesforce\my_sfdx_project
- Create a Salesforce DX project using
sfdx force:project:create
command. In my case:sfdx force:project:create -n force-proj01
- In the newly created folder
force-proj01
, opensfdx-project.json
file and add following line:"oauthLocalPort": "7717",
.
The file will eventually contain:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters{ "packageDirectories": [ { "path": "force-app", "default": true } ], "namespace": "", "sfdcLoginUrl": "https://login.salesforce.com", "oauthLocalPort": "7717", "sourceApiVersion": "45.0" } - Log in using the command
sfdx force:auth:web:login -d -a DevHub
. Now the browser window can open up. Fill in your user name and password to log in. - The browser now will redirect to such a link as
http://localhost:1717/OauthRedirect?code=...
, which is not existing. - Change the port in the link above from
1717
to7717
and press Enter. - Now I can log in to Dev Hub successfully.