Salesforce Cannot start the OAuth redirect server on port 1717の解決方法

環境
Salesforce
Visual Code

現象
21:30:15.510 sf org:login:web –alias vscodeOrg –instance-url https://login.salesforce.com –set-default
Error (PortInUseError): Cannot start the OAuth redirect server on port 1717.

Try this:

Kill the process running on port 1717 or use a custom connected app and update OauthLocalPort in the sfdx-project.json file.

21:30:19.401 sf org:login:web –alias vscodeOrg –instance-url https://login.salesforce.com –set-default
が終了コード 1 で終了しました。

解決方法
1.管理者権限でコマンドプロンプトを起動します

2.以下のコマンドを実行します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
C:\Windows\System32>netstat -ano|findstr :1717
TCP 127.0.0.1:1717 0.0.0.0:0 LISTENING 6580
C:\Windows\System32>netstat -ano|findstr :1717 TCP 127.0.0.1:1717 0.0.0.0:0 LISTENING 6580
C:\Windows\System32>netstat -ano|findstr :1717
TCP 127.0.0.1:1717 0.0.0.0:0 LISTENING 6580

3.プロセスIDを確認してプロセスを強制終了します
C:\Windows\System32>taskkill /PID 6580 /F
成功: PID 6580 のプロセスは強制終了されました。

4.Press F1 and do SFDX: Authorize an Org.

IT

Posted by arkgame