I've got a maven project, within which is JavaScript project cloned as a git sub-module. So the directory structure looks like mavenapp/src/main/javascript/[npm project files]
Inside my package.json, the test looks like this:
"test": "react-scripts test --env=jsdom",
but when I try to run npm test
, it says
'react-scripts' is not recognized as an internal or external command,
Interestingly, when I clone the javascript project independently I don't get this error. I've tried re-running npm install
.
NPM version: 5.5.1
Node.js version: 9.3.0
To solve the error "react-scripts is not recognized as an internal or external command, operable program or batch file", open your terminal in your project's root directory and install the react-scripts package by running npm install react-scripts and clear your npm cache if necessary.
Use npx to solve the error "create-react-app is not recognized as an internal or external command, operable program or batch file", e.g. npx create-react-app my-app or install the package globally by running npm install -g create-react-app . The fastest way to solve the error is to use the npx command.
Run the npm install react-scripts command to solve the "react-scripts: command not found" error. If necessary delete your node_modules directory and your package-lock. json file, reinstall your dependencies and restart your development server.
It is an error about react-scripts file missing in your node_modules/
directory at the time of installation.
Check your react-script dependency is avaliable or not in package.json
.
If not available then add it manually via:
npm install react-scripts --save
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With