Home > OS >  Npm modules not getting installed and throws this error: 'react-scripts' is not recognized
Npm modules not getting installed and throws this error: 'react-scripts' is not recognized

Time:09-18

I went to my github repository of a few months old project. At that time, it was working quite alright.

When I tried to npm install, I can see the node modules folder. Then I have these npm error

enter image description here

Then when I tried, to npm start it shows this error:

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

and then the node modules are deleted. The file would just disappear.

This is the package.json:

enter image description here

CodePudding user response:

You need to run this command

npm install react-scripts --save

CodePudding user response:

npm has problems reading paths with spaces.

You should change the path either by directly removing the spaces or replacing them with some other characters for example _, -, etc.

After that, you should be able to run npm install successfully and then npm start.

Also you can change the cache path like this: Spaces in PATH npm

  • Related