WSL2 中的 F# Fake 运行 解析托管 Windows 中的程序路径,而不是 Linux

F# Fake run in WSL2 resolves the program path in the hosting Windows, not in Linux

环境

问题

我正在关注 SAFE Stack quick start 但 FAKE 构建脚本失败了:

$ dotnet fake build --target run

但是 FAKE 找不到 npm 二进制文件:

Target          Duration
------          --------
Clean           00:00:00.0053439
InstallClient   00:00:00.1517122   (npm was not found in path. Please install it and make sure it's available from your path. See https://safe-stack.github.io/docs/quickstart/#install-pre-requisites for more info)

问题

通过插入调试消息,FAKE build.fsx 脚本似乎解析了来自主机 Windows 的路径,而不是来自 WSL2 Linux 环境的路径:

DEBUG: Some "C:\Program Files\Git\usr\bin\ls.EXE"

脚本示例:

// My Debug
printfn "DEBUG: %A" (ProcessUtils.tryFindFileOnPath "ls")
// The actual script
let npmPath =
    match ProcessUtils.tryFindFileOnPath "npm" with
    | Some path -> path
    | None ->
        "npm was not found in path. Please install it and make sure it's available from your path. "
        + "See https://safe-stack.github.io/docs/quickstart/#install-pre-requisites for more info"
        |> failwith

=> 是错误还是我遗漏了什么?(我对 .Net 和 F# 很陌生)

好的,这对我来说是非常愚蠢的事情:在之前的混合 Windows + WSL 设置中,我向 bash_aliases 添加了一行 alias dotnet=dotnet.exe。我应该在安装 Linux .Net Core 包时删除它

结案