由于尚未安装节点而出现错误

Getting error for not having node installed yet it is installed

在 mac OS 的 Visual Studios 中尝试 运行 使用 dotnet 核心后端和 React 前端 运行 spa 应用程序时发生错误。 这似乎是 Visual Studios 错误

这是错误

Error: Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE.

这是 csproj 文件的相关部分

<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
    <!-- Ensure Node.js is installed -->
    <Exec Command="node --version" ContinueOnError="true">
      <Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
    </Exec>
    <Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
    <Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
    <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
  </Target>

这一行特别是抛出错误

    <Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />

当我打字时 node --version 我得到 v15.5.0

此外,当我在命令行中 运行 应用程序 dotnet run 时,应用程序 运行 完全没问题。有谁知道如何解决这个问题?

这个错误可能是我最近将 Mac OS 升级到 Big Sur 11.1 造成的。我需要做的就是更新 VS 并修复此错误。