npm start error with create-react-app

后端 未结 20 1903
长发绾君心
长发绾君心 2020-11-27 10:18

I have a project who I didn\'t touch for 2 weeks. I take it back and now when I try to run npm start I got this error.

> react-scripts start
         


        
20条回答
  •  悲&欢浪女
    2020-11-27 11:14

    It occurred to me but none of the above worked.

    events.js:72
            throw er; // Unhandled 'error' event
                  ^
    
    npm ERR! UpScore@0.6.0 start: `react-scripts start`
    npm ERR! spawn ENOENT
    
    Error: spawn ENOENT
        at errnoException (child_process.js:1000:11)
        at Process.ChildProcess._handle.onexit (child_process.js:791:34)
    

    This happens because you might have installed react-scripts globally.

    To make this work...

    1. Go to your C:\Users\\AppData\Roaming
    2. Delete npm and npm-cache directories... (don't worry you can install npm globally later)
    3. Go back to your application directory and remove node_modules folder
    4. Now enter npm install to install the dependencies (delete package-lock.json if its already created)
    5. Now run npm install --save react react-dom react-scripts
    6. Get it started with npm start

    This should get you back on track... Happy Coding

提交回复
热议问题