Is there a way in Visual Studio 2017 to automatically enable Docker support for an asp.net-core Angular project? The option is disabled when creating a new one. It is only available for Web Application (MVC).
I am able to Enable Docker support (Project->Add->Docker Support) for the angular project after I have created the project, but when I start the application I get an exception that node.js is not available.
System.AggregateException occurred HResult=0x80131500 Message=One or more errors occurred. (Failed to start Node process. To resolve this:.
[1] Ensure that Node.js is installed and can be found in one of the PATH directories. Current PATH enviroment variable is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin Make sure the Node executable is in one of those directories, or update your PATH.
[2] See the InnerException for further details of the cause.)
Source= StackTrace: at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at Microsoft.AspNetCore.Builder.WebpackDevMiddleware.UseWebpackDevMiddleware(IApplicationBuilder appBuilder, WebpackDevMiddlewareOptions options) at WebApplication3.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env) in C:\Users\temp\Documents\Visual Studio 2017\Projects\WebApplication3\Startup.cs:line 34Inner Exception 1: InvalidOperationException: Failed to start Node process. To resolve this:.
[1] Ensure that Node.js is installed and can be found in one of the PATH directories. Current PATH enviroment variable is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin Make sure the Node executable is in one of those directories, or update your PATH.
[2] See the InnerException for further details of the cause.
Inner Exception 2: Win32Exception: No such file or directory
If it is not possible to create it automatically how can I manually get the Docker support enabled for my Angular project?
I solved my problem.
I needed to install nodejs also on my image, cause it is needed by webpack. I have changed my Dockerfile to also install nodejs version 6
Using only
RUN apt-get update && apt-get install -y nodejs
was not enough, cause this installs version 4 of nodejs and it was installed in foldernodejs
, so that theWebpackDevMiddleware
did not find the node executable.