npm start error with create-react-app

后端 未结 20 1866
长发绾君心
长发绾君心 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 10:49

    Author of Create React App checking in.

    You absolutely should not be installing react-scripts globally.
    You also don't need ./node_modules/react-scripts/bin/ in package.json as this answer implies.

    If you see this:

    npm ERR! UpScore@0.6.0 start: `react-scripts start`
    npm ERR! spawn ENOENT
    

    It just means something went wrong when dependencies were installed the first time.

    I suggest doing these three steps:

    1. npm install -g npm@latest to update npm because it is sometimes buggy.
    2. rm -rf node_modules to remove the existing modules.
    3. npm install to re-install the project dependencies.

    This should fix the problem.
    If it doesn't, please file an issue with a link to your project and versions of Node and npm.

提交回复
热议问题