15

I faced with this problem:

enter image description here

The NPM script 'start' exited without indicating that the create-react-app server was listening for requests. The error output was: 'rimraf' is not recognized as an internal or external command,

operable program or batch file.
npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! [email protected] start: `rimraf ./build && react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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)
1
  • 3
    Put code into codeblocks. Put the output into the psot as text, not images. Also what exaqctly does this have to do with C# and JavaScript? Commented Nov 15, 2019 at 19:21

8 Answers 8

9

I had this problem when made the Node SPA app inside ASP .NET Core and tried to perform start node app in the Production mode. In Development mode everything was OK. This line in Stratup.cs file caused the problem:

spa.UseReactDevelopmentServer(npmScript: "start");

a source of the problem is: in the production mode Node app has been bundled already, i.e. it has no package.json and other Node related files, so start request is not possible to do.

A good way to fix that is to put start in to the clause:

if (env.IsDevelopment())
{
    spa.UseReactDevelopmentServer(npmScript: "start");
}
Sign up to request clarification or add additional context in comments.

3 Comments

I came up with a similar idea myself, although I found that the IsDevelopment check was too coarse for when you want a stack dump on the deployed system: pmichaels.net/2020/07/04/…
This piece of code is already include in .NET 5.0 in the startup class. Thus didn´t work.
@PaulMichaels should be the accepted answer (at least for .net 5)
9

You might have missed installing the dependencies in your source project. That is why it is unable to start to run your application without references.

Run npm install in your source project would resolve the issue

Comments

3

I ran into this problem, after starting afresh with Visual Studio 2019 after a longer break from it (so prette clean setup). It happened when I just tried to set up the simplest ASP.NET Core app, these are the steps I followed / roughly:

  • Check logs in "Event Viewer" for your app - there I found "Could not find 'aspnetcorev2_inprocess.dll'. Exception message: It was not possible to find any compatible framework version The framework 'Microsoft.AspNetCore.App', version '2.2.0' was not found."

  • Went into Visual Studio Installer (Visual Studio | Tools | Get Tools and Features).

  • Select the "Individual Components" tab.
  • Check all (applicable) modules under .NET for ".NET Core .."-anything (I took them all).
  • Hit "Install while loading"
  • Restart Visual Studio.
  • Voila: ASP.NET core app started without errors.

1 Comment

Thanks, this worked for me. I needed to specifically install .net core 3.0 runtime on my pc. I only had 3.1 and 2 and lower installed.
1

I solved my problem by running "npm install rimraf" in the project folder.

Comments

1

In my case, it was a very silly problem. After re-installing my Windows, I missed installing npm altogether and then running npm install.

Comments

1

A similar error as @JamesPoulose but I had installed npm. The problem was I installed it when Visual Studio was open. Event Viewer therefore showed me this error:

Category: Microsoft.AspNetCore.SpaServices

EventId: 0

'npm' is not recognized as an internal or external command,

enter image description here

A simple restart of Visual Studio fixed it.

Comments

0

My colleague, Dave Wilson, fixed this for me. Went to our react project folder and deleted the node_modules. Next went to the command prompt and npm i in the project folder. Checked the output of npm i and saw that Python was not installed when the module fibres has a dependency on it. Installed python and added it to PATH in system variables. The key thing is to check the output of npm i.

Comments

0

I ran into this issue when Selecting HTTPS instead of HTTP. When running it on your localhost. Inside your visual studio project: Properties/launchSettings.json, change "applicationULR" to route to http instead of https(see image)

settings change

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.