简体   繁体   中英

Npm modules not getting installed and throws this error: 'react-scripts' is not recognized as an internal or external command,

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

在此处输入图像描述

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:

在此处输入图像描述

You need to run this command

npm install react-scripts --save

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM