背景
こちらの記事を読ませていただいて、Windowsにてfnmを導入しました。
すると、VSCodeでF5によるJSファイル実行ができなくなってしまいました。
今後も毎回必要になりそうなので、解決策を自分の備忘録のために書いておこう、という記事です。
解決策
launch.jsonの設定を下記のようにする
launch.json
{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Node: Current File (with FNM)",
      "skipFiles": [
        "<node_internals>/**"
      ],
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen",
      "program": "${file}",
      "runtimeExecutable": "fnm",
      "runtimeArgs": [
        "exec",
        "--using-file",
        "--",
        "node"
      ],
      "restart": true
    }
  ]
}
参考リンク
参考というか、上記のissueに答えてくださっている方がいてそのままやりました。
※nameだけ自分が分かりやすいように変更してます。
fnmに変えたことが原因では?という発想に至るまでに無駄に時間がかかってしまい、fnmを検索キーワードに含めたらすぐ答えが見つかりました。。。
