TransWikia.com

'react-scripts' is not recognized as an internal or external command, operable program or batch file

Stack Overflow Asked by David Essien on February 14, 2021

I am learning to react. The version I installed is 16. I installed prop-types via npm after I got an error that ‘react-scripts’ is not recognized as an internal or external command, operable program or batch file."

enter image description here

15 Answers

It is an error about react-scripts file missing in your node modules directory at the time of installation.

Now, you can add manually this via the command:

npm install react-scripts

Correct answer by Yogesh Borad on February 14, 2021

For this error you just have to delete lock file and use command yarn

Answered by Vijay Gaikwad on February 14, 2021

Resolved by running the following command:

yarn add react-scripts

Answered by jdaniel on February 14, 2021

Just type npm install and after that run npm start. This solved the problem for me.

Answered by Farasat Ali on February 14, 2021

It's quite common problem. Do the following steps:-

  • npm audit The message will be like - 7 vulnerabilities (1 low, 6 high) You will get the vulnerabilities, and now fix it with
  • npm audit fix or npm audit fix --force will prompt message like this removed 4 packages, changed 82 packages, and audited 1623 packages in 7s

found 0 vulnerabilities

Problem Solved, Happy Hacking

Answered by Bishnu Kharel on February 14, 2021

deleting the node_modules folder and the *.lock file then running npm install in the project directory through the terminal worked. I tried with yarn install and it worked too after removing the mentioned files above.

Answered by Hassan A on February 14, 2021

I just had this issue and this solution worked just fine.

run:

npm install react-scripts

that should solve it... Enjoy!!!

Answered by David Attah on February 14, 2021

Instead of writing react-scripts start just write npm start.

Answered by Palash Rathore on February 14, 2021

Just go to the Terminal and on the directory which you start your server. TYPE npm install react-scripts

you will be good to go

Answered by ephantus okumu on February 14, 2021

Hello I'm learning the MERN stack as well(wise use of quarantine time right? ) Anyways, I'm using WINDOWS 10, and I have the same error as well.

I tried react-scripts start and react-scripts is not recognized as an internal command

I did a bit of googling and found out that you need to npm install react-scripts -g <- notice the -g (stands for global? I think? )

I hope this helps :>

Answered by Skrmnghrd on February 14, 2021

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

Hope this helps :)

Answered by Harry Karwal on February 14, 2021

One of the causes of this issue is corrupted PATH and the only fix I found for that issue was to (re)install NVM and let the installer take control over the installed Node version when it asks to do so and it will fix the PATH for you. In my case that was the fix.

Answered by Tomáš Hübelbauer on February 14, 2021

I found the community answer, which is perfect solution enter image description here

Answered by Asmi on February 14, 2021

I had the same issue, resolved by simply running following command in the project root folder -

npm install react-scripts --save

Answered by Sachin Vairagi on February 14, 2021

Simply remove node_modules folder and run npm install

Answered by Saurav on February 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP