我剛剛創造了新的ASP.NET Core Web Application
使用預定義模板e.g`文件>新建>項目> Asp.Net核心Web應用程序」。我如何解決「Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException」
我選擇.NET Core 2.0
有角模板。 我使用VS 2017 安裝在我的機器上的節點版本是4.2.2
NPM版本2.14.7
當我跑我得到異常
{Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException: Unexpected token { SyntaxError: Unexpected token { at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:414:25) at Object.Module._extensions..js (module.js:442:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:311:12) at Module.require (module.js:366:17) at require (module.js:385:17) at Object. (c:\users\MyApp\node_modules\@ngtools\webpack\src\index.js:30:10) at Module._compile (module.js:435:26) at Object.Module._extensions..js (module.js:442:10) at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance.d__7
1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult() at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.d__131.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.d__101.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.<InvokeExportWithPossibleRetryAsync>d__10
1.MoveNext()}
OK還是讓我檢查! – simbada
是的,謝謝它在我升級了我的Node和Npm版本後工作。 – simbada