-3

I am getting this error while doing "npm start"

npm start
npm ERR! Missing script: "start" npm ERR! npm ERR! Did you mean one of these? npm ERR! npm star # Mark your favorite packages npm ERR! npm stars # View packages marked as favorites npm ERR! npm ERR! To see a list of scripts, run: npm ERR! npm run

I have installed the latest version, also have installed the react-scripts. Not able to analyze the actual issue. If someone can help, it will be really helpful.

  • 2
    [You need to define a start script in your package.json](https://stackoverflow.com/questions/31976722/start-script-missing-error-when-running-npm-start) – Zac Anger May 15 '23 at 13:14

1 Answers1

0

This happens when you haven't created a start script in your package.json. You can do it like this:

"scripts": {
    "start": "[your script]"
}

If you are a beginner, I'll suggest you to create a react app using one of the following commands to create boilerplate code:

npx create-react-app .
(I'll suggest you this one!)
npm init react-app .
yarn create react-app .

The . represents the location. By selecting the dot, you are telling the computer to create a react-app template in the current directory.

Once you start to get more and more advanced, I'll suggest you to try Gatsby and Vite too, but if you're a beginner, you should stick with create-react-app.

Anyways, you can find all of the documentation here: https://create-react-app.dev/docs/documentation-intro

Alexxino
  • 557
  • 2
  • 16
  • Thank you so much for your help. But I can see start script in already included in package.json "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, – Moumita Gandhi May 16 '23 at 05:00