Building an ASP.NET 5 application with typescript inside docker

  asp.net, docker, typescript

I am trying to build my project inside a docker container using the dotnet sdk container mcr.microsoft.com/dotnet/sdk:5.0. Without docker on my local machine i can just build and run it just fine, but when i build my project inside the sdk container I get the error:

error MSB6003: The specified task executable "node" could not be run.

So i installed node in the container and got this instead:

tsc : error TS2468: Build:Cannot find global value 'Promise'. [/<projectname>/<projectname>/<projectname>.csproj]
/<projectname>/<projectname>/scriptsgame.ts(78,17): error TS2503: Build:Cannot find namespace 'NodeJS'. [/<projectname>/<projectname>/<projectname>.csproj]
/<projectname>/<projectname>/scriptsgame.ts(327,26): error TS2705: Build:An async function or method in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option. [/<projectname>/<projectname>/<projectname>.csproj]

How can i fix this?

Source: Docker Questions

LEAVE A COMMENT