我使用vs2017在mac中创建了一个角形应用程序,并遵循了Creating a new Angular project on Mac with Visual Studio示例形式,为三个项目提供了docker支持。因为另一个项目是Web。因为另一个项目正在码头上成功运行。然而,只有角应用程序没有运行,它抛出一个错误,如下所示
System.AggregateException: "One or more errors occurred. (Failed to start Node process. To resolve this:.\n\n[1] Ensure that Node.js is installed and can be found in one of the PATH directories.\n Current PATH enviroment variable is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n Make sure the Node executable is in one of those directories, or update your PATH.\n\n[2] See the InnerException for further details of the cause.)" ---> System.Exception {System.InvalidOperationException}: "Failed to start Node process. To resolve this:.\n\n[1] Ensure that Node.js is installed and can be found in one of the PATH directories.\n Current PATH enviroment variable is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n Make sure the Node executable is in one of those directories, or update your PATH.\n\n[2] See the InnerException for further details of the cause." ---> System.Exception {System.ComponentModel.Win32Exception}: "No such file or directory"
at at System.Diagnostics.Process.ResolvePath(String filename)\n at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)\n at System.Diagnostics.Process.Start()\n at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)\n at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.LaunchNodeProcess(ProcessStartInfo startInfo)
--- End of inner exception stack trace ---
at at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.LaunchNodeProcess(ProcessStartInfo startInfo)\n at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance..ctor(String entryPointScript, String projectPath, String[] watchFileExtensions, String commandLineArguments, CancellationToken applicationStoppingToken, ILogger nodeOutputLogger, IDictionary`2 environmentVars, Int32 invocationTimeoutMilliseconds, Boolean launchWithDebugging, Int32 debuggingPort)\n at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance..ctor(NodeServicesOptions options, Int32 port)\n at Microsoft.AspNetCore.NodeServices.HostingModels.NodeServicesOptionsExtensions.<>c__DisplayClass0_0.<UseHttpHosting>b__0()\n at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.CreateNewNodeInstance()\n at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.GetOrCreateCurrentNodeInstance()\n at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.<InvokeExportWithPossibleRetryAsync>d__10`1.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)\n at Microsoft.AspNetCore.Builder.WebpackDevMiddleware.UseWebpackDevMiddleware(IApplicationBuilder appBuilder, WebpackDevMiddlewareOptions options)\n at WebApp.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env) in /Users/macbook/Projects/MeroRental/WebApp/Startup.cs:line 34\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)\n at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)\n at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()\n at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()\n at WebApp.Program.BuildWebHost(String[] args) in /Users/macbook/Projects/MeroRental/WebApp/Program.cs:line 21\n at WebApp.Program.Main(String[] args) in /Users/macbook/Projects/MeroRental/WebApp/Program.cs:17



试图解决来自此链接https://github.com/aspnet/JavaScriptServices/issues/707的错误,但没有结果。

发布于 2018-06-02 02:46:40
从这个链接中找到了解决方案,它起了作用。
https://github.com/aspnet/JavaScriptServices/issues/1534#issuecomment-366605094
修改了角应用程序停靠文件
更改这一行
FROM microsoft/aspnetcore:2.0 AS base到
FROM microsoft/aspnetcore-build:2.0 AS base更新的码头文件
FROM microsoft/aspnetcore-build:2.0 AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY MeroRental.sln ./
COPY WebApp/WebApp.csproj WebApp/
RUN dotnet restore -nowarn:msb3202,nu1503
COPY . .
WORKDIR /src/WebApp
RUN dotnet build -c Release -o /app
FROM build AS publish
RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "WebApp.dll"]https://stackoverflow.com/questions/50505974
复制相似问题