The npm script start exited without indicating that the create-react-app

Running Windows 10 (Build 18362), using Node.js v10.16.0, npm v6.9.0, and .Net Core v2.2.300.
I created a sample React/Redux application in Visual Studio 2017 via File->New Project, selecting ASP.NET Core Web Application, then selecting React.js and Redux. However, when starting the application via Visual Studio, the browser encounters a 500 error and says:


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: '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.

To start, I've uninstalled and reinstalled node and npm, deleted node_modules and re-ran npm install. I rebooted before and after re-installing node.

I know that rimraf is installed in the local .\node_modules directory, as I can successfully run .\node_modules\.bin\rimraf. And react-scripts start starts the react portion of the application successfully if I run .\node_modules\.bin\react-scripts start, but why would npm fail to find this?

It's to my understanding that npm adds the local node_modules\.bin to the PATH at the time of script execution, yet it still fails to find both rimraf and react-scripts despite them being accessible if providing an absolute path to the shell.

I have also tried adding .\node_modules\.bin to my system PATH, which allows me (provided I'm in the root of my app directory) to just run react-scripts start and have the application load, but npm run start still fails.

Here is my package.json:


{
"name": "WebApplication1",
"version": "0.1.0",
"private": true,
"dependencies": {
"bootstrap": "^4.3.1",
"jquery": "3.3.1",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-redux": "^5.0.6",
"react-router-bootstrap": "^0.24.4",
"react-router-dom": "^4.2.2",
"react-router-redux": "^5.0.0-alpha.8",
"react-scripts": "^1.1.5",
"reactstrap": "^6.3.0",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0",
"rimraf": "^2.6.2"
},
"devDependencies": {
"ajv": "^6.0.0",
"babel-eslint": "^7.2.3",
"cross-env": "^5.2.0",
"eslint": "^4.1.1",
"eslint-config-react-app": "^2.1.0",
"eslint-plugin-flowtype": "^2.50.3",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.11.1"
},
"eslintConfig": {
"extends": "react-app"
},
"scripts": {
"start": "rimraf ./build && react-scripts start",
"build": "react-scripts build",
"test": "cross-env CI=true react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"lint": "eslint ./src/"
}
}

Hello,

I am programming a SPA using React, ASP.net core and mysql( which this is the requirement).
I am using Visual studio 2019, I install node.js and MySQL connector and everything is connected and fine.
but one problem I have that when I ran the app, the following error occur:

{

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 1

npm ERR! path C:\Users\  \source\repos\WebApplication1\ClientApp
npm ERR! command failed

npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c rimraf ./build && react-scripts start


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

))
System.Threading.Tasks.Task.ThrowIfExceptional(bool includeTaskCanceledExceptions)

InvalidOperationException: 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 1

npm ERR! path C:\Users\  \source\repos\WebApplication1\ClientApp
npm ERR! command failed

npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c rimraf ./build && react-scripts start


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

Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer.ReactDevelopmentServerMiddleware.StartCreateReactAppServerAsync(string sourcePath, string npmScriptName, ILogger logger)

}

What to do ?

What I have tried:

I have tried to reinstall and nothing happened.

I have search the web and nothing works.things I tried:
npm install in the command line and still nothg

rm -rf node_module also did not work since the command are for Linux and I am using Windows OS


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900

Why is npm start giving error?

Missing script: "start" error occurs for multiple reasons: Missing a start script in the scripts section of your package. json file. Opening your IDE or shell in a directory that doesn't contain your package.

How do I fix npm install error?

Did you can try it :.
Delete node_modules folder and package-json. lock..
Then run npm i..
If problem still exists repeat point 1 and go to 4 point..
Update npm with command npm i -g npm..
Run command npm cache verify and then run npm i..

How do I open npm in terminal?

npm start..
> node foo.js..
(foo.js output would be here).

What react scripts start does?

To execute this script, run npm run start in your command line. You can also use the shorthand command npm start . It tells create-react-app to set up a development environment, start a local server, and a hot module reloading.