Missing Script when I run npm start to create React app

前端 未结 9 1241
北荒
北荒 2021-01-01 18:20

I\'m trying to run the React server by running npm start

When I do this I get a missing script error:

λ npm start
npm ERR! missing scrip         


        
相关标签:
9条回答
  • 2021-01-01 18:51

    For windows

    tried npm uninstall -g create-react-app that didn't work for me.

    I did the following and it worked:

    1. Elevated cmd prompt (or Git Bash): where create-react-app it was somewhere in the system files under yarn. follow that path and delete both the files.
    2. Go to the working directory where you want the project, in my case a folder inside Documents\Projects. run npx create-react-app my-test-app

    This will create a new folder called my-test-app and you can follow the rest of the instructions on the react app website.

    cd into that new folder, run

    yarn start

    0 讨论(0)
  • 2021-01-01 18:54

    For me the problem was caused because npx create-react-app my-app was not triggering npm install due to lack of user permission. Please run :

    sudo npx create-react-app my-app
    

    Solves the problem.

    0 讨论(0)
  • 2021-01-01 18:55

    Update create-react-app package to solve this problem.

    For updating the concerned package run the following command: npm install -g create-react-app

    0 讨论(0)
提交回复
热议问题