create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

'react-scripts' is not recognized error even though it's in node_modules and package.json

Open ppowell777 opened this issue 6 months ago • 1 comments

I created a React project within IntelliJ IDEA using npx create-react-app within IntelliJ. All was successfully set up for me to have the project. I verified that react-scripts was found within both the generated node_modules and mentioned within package.json:

"dependencies": { "@testing-library/dom": "^10.6.0", "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.3.0", "@testing-library/user-event": "^13.5.0", "@trussworks/react-uswds": "^10.0.2", "react": "^19.1.0", "react-dom": "^19.1.0", "react-scripts": "^0.0.0", "web-vitals": "^2.1.4" }, "scripts": { "start": "react-scripts start", "build" "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }

Also the node_modules\react-scripts contains its own package.json:

{ "name": "react-scripts", "version": "0,0,0", "description": "" } I honestly don't know what else to do. I tried npm install for nothing to happen; I tried npm audit fix --force for nothing to happen. I even destroyed and recreated the project, and the exact same problem occurs. I don't know what else to do, but this project cannot run whatsoever.

Please let me know what else I may have missed or what I need to do differently.

Thanks

ppowell777 avatar Jul 02 '25 12:07 ppowell777

I wound up solving the problem, or, rather, "solving" the problem, by destroying and recreating the entire create-react-app React project in IntelliJ over again, and, this time, after doing npm install @trussworks/react-uswds I chose not to try to fix the 9 vulnerabilities via npm audit fix --force and I was now able to use react-scripts, assuming that the earlier audit fix effectively wiped out react-scripts

ppowell777 avatar Jul 02 '25 16:07 ppowell777