I\'ve got a maven project, within which is JavaScript project cloned as a git sub-module. So the directory structure looks something like
mavenapp/src/main/jav
For Portable apps change
package.json
as follows
"scripts": {
"start": "node node_modules/.bin/react-scripts start",
"build": "node node_modules/.bin/react-scripts build",
"test": "node node_modules/.bin/react-scripts test",
"eject": "node node_modules/.bin/react-scripts eject"
}
I have tried many of the solutions to this problem found on line, but in my case nothing worked except for reinstalling NVM for Windows (which I am using to manage multiple Node versions). In the installer, it detects installed Node versions and asks the user if they wish for NVM to control them. I said yes and NVM fixed all PATH issues. As a result, things worked as before. This issue may have multiple causes, but corrupted PATH is definitely one of them and (re)installing NVM fixes PATH.
Faced the same problem, although I am using yarn.
The following worked for me:
yarn install
yarn start
In my situation, some problems happened with my node package. So I run npm audit fix
and it fixed all problems
npm install
npm run start
if this didn't work, try to install the nodejs and run repair
or clean npm cache npm cache clean --force
Edit the system environmental variable
Environment Variables...
Path
variable nameEdit..
C:\Program Files\nodejs
on the list, if not add thisWhen I make a new project using React, to install the React modules I have to run "npm install" (PowerShell) from within the new projects ClientApp folder (e.g. "C:\Users\Chris\source\repos\HelloWorld2\HelloWorld2\ClientApp"). The .NET core WebApp with React needs to have the React files installed in the correct location for React commands to work properly.