2016-12-20 230 views
3

我跟着this有關使角度和ASP.NET Core一起運行的教程。初始構建工作正常,但更新角度包後,我在應用程序啓動時收到以下錯誤(我也必須重新安裝nodejs在過程中,不知道這是否相關):ASP.NET Core系統找不到指定的文件

錯誤是在以下行:

app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { 
    HotModuleReplacement = true 
}); 

enter image description here

enter image description here

錯誤本身不提供我任何有用的信息,以追查問題。

我得到一個:

System.AggregateException => Count = error CS0103: The name 'InnerExceptionCount' does not exist in the current context

在InnerExceptions它列出了以下錯誤:

System.ComponentModel.Win32Exception: The system cannot find the file specified at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.LaunchNodeProcess(ProcessStartInfo startInfo) at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance..ctor(String entryPointScript, String projectPath, String[] watchFileExtensions, String commandLineArguments, ILogger nodeOutputLogger, IDictionary2 environmentVars, Int32 invocationTimeoutMilliseconds, Boolean launchWithDebugging, Int32 debuggingPort) at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance..ctor(String projectPath, String[] watchFileExtensions, ILogger nodeInstanceOutputLogger, IDictionary2 environmentVars, Int32 invocationTimeoutMilliseconds, Boolean launchWithDebugging, Int32 debuggingPort, Int32 port) at Microsoft.AspNetCore.NodeServices.NodeServicesFactory.CreateNodeInstance(NodeServicesOptions options) at Microsoft.AspNetCore.NodeServices.NodeServicesFactory.<>c__DisplayClass0_0.b__0() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.CreateNewNodeInstance() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.GetOrCreateCurrentNodeInstance() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.d__10`1.MoveNext()}

如果有人可以點我的方向得到錯誤的詳細信息將是有益的。

回答

2

看起來它無法找到node.exe。第一次安裝Node後,我看到了同樣的錯誤。這是因爲安裝Node修改了系統路徑,並且新路徑沒有被IIS獲取。我必須重新啓動我的服務器,然後才能找到節點exe。

+0

重新啓動後一切都很好。 –

0

檢查您是否安裝了最新的NPM。這解決了我的問題。

相關問題