当我尝试运行我的项目时,我总是会收到以下错误:
An unhandled exception occurred while processing the request. AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the create-react-app server was listening for requests. The error output was: )) System.Threading.Tasks.Task<TResult>.GetResultCore(bool waitCompletionNotification) InvalidOperationException: The NPM script 'start' exited without indicating that the create-react-app server was listening for requests. The error output was: Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer.ReactDevelopmentServerMiddleware.StartCreateReactAppServerAsync(string sourcePath, string npmScriptName, ILogger logger) Stack Query Cookies Headers AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the create-react-app server was listening for requests. The error output was: )) System.Threading.Tasks.Task<TResult>.GetResultCore(bool waitCompletionNotification) Microsoft.AspNetCore.SpaServices.Extensions.Util.TaskTimeoutExtensions.WithTimeout<T>(Task<T> task, TimeSpan timeoutDelay, string message) Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.PerformProxyRequest(HttpContext context, HttpClient httpClient, Task<Uri> baseUriTask, CancellationToken applicationStoppingToken, bool proxy404s) Microsoft.AspNetCore.Builder.SpaProxyingExtensions+<>c__DisplayClass2_0+<<UseProxyToSpaDevelopmentServer>b__0>d.MoveNext() Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) Garrigues.BDC.Web.Classes.LoggingMiddlewareFront.Invoke(HttpContext httpContext, IUserInfo userInfo) in LoggingMiddlewareFront.cs + await _next(httpContext); Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context) Show raw exception details InvalidOperationException: The NPM script 'start' exited without indicating that the create-react-app server was listening for requests. The error output was: Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer.ReactDevelopmentServerMiddleware.StartCreateReactAppServerAsync(string sourcePath, string npmScriptName, ILogger logger)
我已经尝试了我在网上看到的所有东西,但仍然失败。我已经执行了";npm安装";以及我在网上类似问题中看到的许多npm命令。我已经更新了npm、node.js和visualstudio。
取消安装节点并重新安装。还请安装nvm(节点版本管理器(。
不是这样的解决方案,但运行yarn start
(或npm start
,取决于您使用的内容(应该会给您实际的错误消息。