• Register
0 votes
790 views

Problem :

I am new to Programming. I have created a Maven Project, the JavaScript project is cloned as the git sub-module inside Maven Project. My directory structure is as below

mavenapp/src/main/javascript/[npm project files]

and inside the package.json my test is looking as below : 

"test": "react-scripts test --env=jsdom"

If I try to run the npm test then it is giving me below error:

“'React-scripts' is not recognized as an internal or external command,”

I have already tried to re-run the npm install But it is not working for me..

npm version : 5.5.1

node version : 9.3.0

How can I fix above error?

8 4 2
2,300 points

Please log in or register to answer this question.

2 Answers

0 votes

Solution :

I had faced this error before. I have done research on it and then came up with below solution.

If you have the react-scripts in your package.json

If you are sure that you have seen  "react-scripts": "2.1.3" this in the pakage.json file then your job is very easy you just need to type below command

npm install

If you do not have the react-scripts  in your package.json

If you are sure that you have not seen   "react-scripts" this in your package.json file then maybe you have not yet installed it. So To install that you must type the below command

npm install react-scripts --save

And now you are completely set to go ahead.

5 2 1
4,980 points
0 votes

Solution:

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 manually via:

npm install react-scripts --save

or You can try

rm -rf node_modules && npm install

Wiping node_modules first, often tends to fix a lot of weird, package related issues like that in Node.

If react-scripts is present in package.json

If you see something like this "react-scripts": "2.1.3" in your pakage.json file then just type this command

npm install
If react-scripts is not present in package.json

If there is nothing like "react-scripts" in your package.json file then probably you have not installed it.To do that type the following command and you will be all set

npm install react-scripts --save

If none of the above solutions works and you have already installed the "react-scripts" package using

npm install react-scripts --save

You can try the below solution to run the application.

You should see the following in your package.json file

"scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
}

The script : "start": "react-scripts start" is linked to the file : nodemon node_modules/react-scripts/scripts/start.js which is used to start the project in the development env

Try to start the project directly using the below commands:

node node_modules/react-scripts/scripts/start.js

 

or if you have nodemon installed then try

nodemon node_modules/react-scripts/scripts/start.js

 

10 6 4
31,120 points

Related questions

0 votes
1 answer 37 views
37 views
Problem: I faced this error, how I can fix it: Nodemon' is not recognized as an internal or external command, operable program or batch file.
asked Mar 13 Wafa Abu Yousef 6.1k points
0 votes
1 answer 2.7K views
2.7K views
Problem : I am beginner in the node.js .Currently I am trying to install node.js using the below command npm install nodemon --save. But when I try to run a server with below command nodemon server.js. then in my terminal I face below error: “Nodemon is not recognized as internal or external command, operable program or batch file”
asked Feb 13, 2020 mphil 2.3k points
0 votes
1 answer 8 views
8 views
Problem: What does this mean and how can I solve this > Node_env' is not recognized as an internal or external command, operable program or batch file.
asked Apr 22 ummeshani 10.8k points
0 votes
1 answer 49 views
49 views
Problem: I have faced this message, any help: 'Tsc' is not recognized as an internal or external command, operable program or batch file.
asked Mar 14 Wafa Abu Yousef 6.1k points
0 votes
1 answer 14 views
14 views
Problem: node is not recognized as an internal or external command.
asked Feb 23 Ethan ross 2.7k points
0 votes
1 answer 44 views
44 views
Problem: I am very new to cordova, phonegap, ant,sdk,jdk. I am learning to use phonegap/cordova. Everything is installed properly on my machine i.e cordova, phonegap, ant,sdk,jdk. But now suddenly it started saying that: "’Node' is not recognized as an ... insufficient knowledge I am unable to fix this issue. I am looking for cordova and phonegap experts who can help me in fixing this issue.
asked Sep 2, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 2K views
2K views
Problem : I am new to type script and unable to compile my type script file. When I try to hit Ctrl+Shift+B in my VS Code, I face below error " ‘Tsc' is not recognized as an internal or external command, operable program or batch file." I used ... C:\Users\mphil\AppData\Roaming\npm\node_modules\typescript\bin\tsc C:\Users\mphil\AppData\Roaming\npm `-- typescript@2.1.5 How to fix above error?
asked Feb 15, 2020 mphil 2.3k points
0 votes
1 answer 107 views
107 views
Problem : Facing following Node.Js error 'npm' is not recognized as an internal or external command, operable program or batch file.
asked Nov 18, 2019 peterlaw 6.9k points
0 votes
1 answer 14 views
14 views
Problem: 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 ... 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
asked May 3 jamuna1 30.2k points
1 vote
1 answer 8 views
8 views
Problem: How to fix this error? Cordova' is not recognized as an internal or external command, operable program or batch file.
asked Apr 22 PkGuy 23.5k points