-1
$ 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

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\DELL\AppData\Local\npm-cache\_logs\2023-02-08T16_03_46_369Z-debug-0.log

What is causing this? Please note this is the first time I am running this command on this machine. I tried running npm install before hitting npm start and it says the app is up to date but 231 packages are looking for funding. Don't understand what any of that means. Would really appreciate if anyone explained the cause to me while giving a fix.

Thanks.

Devansh Gupta
  • 59
  • 1
  • 8
  • can you add the scripts part of your package.json? – terpinmd Feb 08 '23 at 16:20
  • Does this answer your question? [Start script missing error when running npm start](https://stackoverflow.com/questions/31976722/start-script-missing-error-when-running-npm-start) – I.sh. Feb 08 '23 at 16:24
  • @terpinmd Ok there is no scripts part in the package.json file. I reckon that is supposed to be there by default? I ran npx create-react-app react-app command to create the project like everyone else and my node and npm are up to date. – Devansh Gupta Feb 08 '23 at 16:36

1 Answers1

0

This error message is indicating that you're trying to run an "npm start" script in your project, but it's not defined in your project's "scripts" section in the package.json file. You should have a script like this:

"scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
Digimhotep
  • 56
  • 3
  • I don't actually have a script like that in my package.json – Devansh Gupta Feb 08 '23 at 16:41
  • You cannot use the start script without the package.json file. – Digimhotep Feb 08 '23 at 18:10
  • I do have a package.json file and this is what it looks like: { "name": "react-app", "version": "0.1.0", "private": true, "dependencies": { "cra-template": "1.2.0", "react": "18.2.0", "react-dom": "18.2.0", "react-scripts": "5.0.1" } } Should the script go in there somewhere? – Devansh Gupta Feb 09 '23 at 10:42