npm start error with create-react-app

后端 未结 20 1865
长发绾君心
长发绾君心 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:53

    It seems like you don't have react-scripts in your global environment. Two possibility are available here :

    npm install -g react-scripts

    or in your package.json change your script part like this :

      "scripts": {
        "start": "./node_modules/react-scripts/bin/react-scripts.js start",
        "start:prod": "pushstate-server build",
        "build": "./node_modules/react-scripts/bin/react-scripts.js build",
        "test": "./node_modules/react-scripts/bin/react-scripts.js test --env=jsdom",
        "eject": "./node_modules/react-scripts/bin/react-scripts.js eject",
        "server": "cd client/api && pm2 start server.js --watch",
        "proxy": "http://128.199.139.144:3000"
      },
    

提交回复
热议问题