Nuget package Microsoft.TypeScript.MSBuild fails in Dockerfile Nuget package Microsoft.TypeScript.MSBuild fails in Dockerfile docker docker

Nuget package Microsoft.TypeScript.MSBuild fails in Dockerfile


On Windows, Microsoft.TypeScript.MSBuild includes tsc.exe. On non-Windows platforms, such as in a Docker container, Microsoft.TypeScript.MSBuild does not include ts.exe and instead shells out to a Node for the TypeScript compiler. The official dotnet/sdk Docker images I think included Node at one point in the past, but they no longer include Node. You will either need to make or find a Docker image with both the dotnet-sdk and Node, or configure some multi-stage build involving the official Node image.


Thanks for the question! Saved me from asking it myself.

For me the fix was as simple as running sudo apt-get install nodejs(Using Ubuntu 18.04)


In linux containers You have to install node first. Add the following lines to your dockerfile. Add it before "RUN dotnet build"

RUN apt-get update -yq && apt-get upgrade -yq && apt-get install -yq curl git nanoRUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && apt-get install -yq nodejs build-essentialRUN npm install -g npmRUN npm install