【发布时间】:2023-03-24 05:50:02
【问题描述】:
我使用 Visual Studio 2019 创建了一个带有 React.js 模板的 ASP.NET Core 3.1 项目
当我将项目作为 React.js 应用程序运行时,一切正常。但是当我将应用程序更改为 NextJS 应用程序时,当我运行它时,我给了我错误:
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: Error: Could not find a valid build in the 'C:\Users\myname\source\repos\Panel\Panel\ClientApp\.next' directory! Try building your app with 'next build' before starting the server.
我可以使用 npm run dev 运行应用程序,但我想在运行 ASP.NET Core 应用程序的同一端口上使用 Visual Studio 运行应用程序,例如 React.js 应用程序。
如何添加 npm run dev 之类的命令并执行它们以在同一端口上运行应用程序?
【问题讨论】:
标签: node.js reactjs asp.net-core next.js csproj