環境
- Windows 10 pro
- Visual Studio Code 1.38.1 (2019-09-11以降)
- Git BashのSSHを使用 (参考:Git BashでWindowsで気軽にSSHコマンドを使う)
現象
Remote Developerをインストール後、仮想環境に接続しようとしたら以下のエラーが表示された。
remote-ssh@0.47.2
win32 ia32
SSH Resolver called for "ssh-remote+localhost", attempt 1
SSH Resolver called for host: localhost
Setting up SSH remote "localhost"
Using commit id "" and quality "stable" for server
Finding installed ssh failed: The "path" argument must be of type string. Received type undefined
Resolver error: The "path" argument must be of type string. Received type undefined
localhost
はホスト名。
今回はVagrantの仮想環境に接続するため、.ssh\config
は以下の通り。
Host localhost
HostName localhost
User vagrant
Port 2222
IdentityFile [ your private_key path ]
原因
Finding installed ssh failed
との記述があるので、VS CodeからPC上のssh.exe
が見つからない模様。
Finding installed ssh failed: The "path" argument must be of type string. Received type undefined
Resolver error: The "path" argument must be of type string. Received type undefined
解決策
「設定 > 拡張機能 > Remote SSH > Path」に、ssh.exe
のPathを追記する。
以上