kelps / TypeScriptBuildRepro

Repro for a typescript build error. Works when building from VS19 but fails when building from "dotnet build"
0 stars 0 forks source link

Works on 16.5 w/SDK 3.1.102 #1

Open timheuer opened 4 years ago

timheuer commented 4 years ago

I was able to build with no errors.

❯ dotnet build
Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 3.47 sec for C:\users\timheuer\documents\github\TypeScriptBuildRepro\TestTypeScript\TestTypeScript.csproj.
  TestTypeScript -> C:\users\timheuer\documents\github\TypeScriptBuildRepro\TestTypeScript\bin\Debug\netcoreapp3.1\TestTypeScript.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)
kelps commented 4 years ago

How does one get 16.5 of the dotnet CLI? VS 16.5 was not yet available to me until today. I am installing it now and then I'm gonna update my .NET Core SDK to the latest version and see if it solves it.

Is there another way to get updates to dotnet CLI, or only by manual download and install?

timheuer commented 4 years ago

Updates on dotnet CLI you can get through dot.net/downloads

kelps commented 4 years ago

after updating visual studio to 16.5, I got the new dotnet CLI 3.1.200, but still getting the same error.

❯ dotnet build
Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 427,23 ms for C:\Users\kelps\Source\Repos\TypeScriptBuildRepro\TestTypeScript\TestTypeScript.csproj.
C:\Users\kelps\.nuget\packages\microsoft.typescript.msbuild\3.8.3\tools\Microsoft.TypeScript.targets(311,5): error : The build task could not find node.exe which is required to run the TypeScript compiler. Please install Node and ensure that the system path contains its location. [C:\Users\kelps\Source\Repos\TypeScriptBuildRepro\TestTypeScript\TestTypeScript.csproj]

Build FAILED.

C:\Users\kelps\.nuget\packages\microsoft.typescript.msbuild\3.8.3\tools\Microsoft.TypeScript.targets(311,5): error : The build task could not find node.exe which is required to run the TypeScript compiler. Please install Node and ensure that the system path contains its location. [C:\Users\kelps\Source\Repos\TypeScriptBuildRepro\TestTypeScript\TestTypeScript.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.57

As I said before, the BuildWebCompiler nuget package from @madskristensen also uses node in its compilations of .less, .sass, etc and it works without requiring a stand alone node installation. I'm not sure how he does it, but It works, both in my computers and in the Azure DevOps Pipeline, while the TypeScript build fails (only works in my local Visual Studio).