gpt4 book ai didi

c# - NPM脚本 'start'退出但未指示create-react-app服务器正在监听请求

转载 作者:行者123 更新时间:2023-12-03 12:11:40 26 4
gpt4 key购买 nike

我遇到了这个问题。请您帮我解决一下问题。

enter image description here

NPM脚本“开始”退出,但未指示create-react-app服务器正在监听请求。错误输出为:'rimraf'不被识别为内部或外部命令,

operable program or batch file.
npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! CallerPanelProject@0.1.0 start: `rimraf ./build && react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the CallerPanelProject@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:

))
TSystem.Threading.Tasks.Task<TResult>.GetResultCore(bool waitCompletionNotification)

最佳答案

在ASP .NET Core中制作Node SPA应用程序并尝试在生产模式下执行start Node 应用程序时遇到了这个问题。在开发模式下,一切正常。Stratup.cs文件中的这一行引起了问题:

spa.UseReactDevelopmentServer(npmScript: "start");
问题的根源是:在生产模式下,Node应用已被捆绑,即它没有package.json和其他与Node相关的文件,因此无法执行 start请求。
解决该问题的一种好方法是将 start放入子句中:
if (env.IsDevelopment())
{
spa.UseReactDevelopmentServer(npmScript: "start");
}

关于c# - NPM脚本 'start'退出但未指示create-react-app服务器正在监听请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58883331/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com