1

I created a new react app using CRA. As soon as I started the development server, it throws the error and exits.

Starting the development server...                                               

events.js:174                                                                    
      throw er; // Unhandled 'error' event                                       
      ^                                                                          

Error: spawn cmd ENOENT                                                          
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)    
    at onErrorNT (internal/child_process.js:415:16)                              
    at process._tickCallback (internal/process/next_tick.js:63:19)               
Emitted 'error' event at:                                                        
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)    
    at onErrorNT (internal/child_process.js:415:16)                              
    at process._tickCallback (internal/process/next_tick.js:63:19)               
npm ERR! code ELIFECYCLE                                                         
npm ERR! errno 1                                                                 
npm ERR! cart-redux@0.1.0 start: `react-scripts start`                           
npm ERR! Exit status 1                                                           
npm ERR!                                                                         
npm ERR! Failed at the cart-redux@0.1.0 start script.                            
npm ERR! This is probably not a problem with npm. There is likely additional logg
ing output above.                                                                

npm ERR! A complete log of this run can be found in:                             
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs\2019-05-26T09_32_50_014Z
-debug.log  

The react-scripts version 3.0.1 is avoiding to 'npm start'. I tried downgrading to version 2.1.8, it works fine. But I don't want to downgrade the version everytime to make my app work. I tried following the similar case, but it didn't help. Any one else facing the issue, please help to resolve it.

program_bumble_bee
  • 439
  • 2
  • 25
  • 57

1 Answers1

3

if you tried this and it didn't work for you then this maybe a react-scripts issue so to fix it try this:

remove node_modules and lock files
edit package.json so the version of react-scripts is "2.1.8"
npm install
npm start

LTK how that goes

Roy.B
  • 2,076
  • 14
  • 23
  • Yea. Degrading the version works fine. But should not be there any other way to solve this. Degrading version every time doesn't seem good practice? – program_bumble_bee May 27 '19 at 18:08
  • 1
    @bubble-cord look good practice in my opinion is making the right decision based on the options you have, its all about what's your options, you can find other library, or you can downgrade to a stable version and wait until they will fix it in newer versions.. you decide. In my opinion wait and stay tuned for a newer version – Roy.B May 27 '19 at 18:27