Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'react-scripts' is not recognized as an internal or external command

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

like image 209
J Smith Avatar asked Oct 01 '22 08:10

J Smith


People also ask

How do you fix react-scripts is not recognized as an internal or external command?

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.

How do you fix create-react-app is not recognized as an internal or external command operable program or batch file?

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.

How do you fix react-scripts is not found?

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.


1 Answers

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
like image 229
Yogesh Borad Avatar answered Oct 19 '22 19:10

Yogesh Borad