0

I just created a react app by using the create-react-app command and I gave the app the name react-app. I followed these steps

  • cd into that directory using cd react-app/
  • running the npm start command

I ran into an error that says;

npm ERR! Missing scripts: start
npm ERR! A complete log of this run can be found in:
C:\Users\user\Appdata\Roaming\npm-cache\_logs\2020-11-09T07_00_18_996z-debug.log

Edit: Here is the content of my package.json:

{
  "name": "react-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^17.0.1",
    "react-dom": "^17.0.1",
    "react-scripts": "4.0.0"
  }
}

Adding those scripts to my package.js worked but initiated another issue. Here is the snippet. Thanks folks enter image description here

RobC
  • 22,977
  • 20
  • 73
  • 80
  • npm i react-scripts – zahra zamani Nov 09 '20 at 07:23
  • maybe this link will help you https://stackoverflow.com/questions/31976722/start-script-missing-error-when-running-npm-start#:~:text=If%20there%20is%20a%20server,js.&text=This%20error%20also%20happens%20if,script%22%20key%20in%20the%20package. – zahra zamani Nov 09 '20 at 07:26
  • Does this answer your question? [Missing Script when I run npm start to create React app](https://stackoverflow.com/questions/56148511/missing-script-when-i-run-npm-start-to-create-react-app) – Ntshembo Hlongwane Nov 09 '20 at 08:59
  • Thanks @Ntshembo Hlongwane. The link was pretty helpful. I appreciate – Dominique Nov 09 '20 at 17:02

1 Answers1

0

You have to have these scripts at your package.json.

My package.json

"scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  }

yetgins
  • 48
  • 1
  • 7