Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React: missing script: start

how to run npm start

Bhanukas-MacBook-Pro:Shopping Card Admin Panel bhanukaisuru$ npm start npm ERR! missing script: start

npm ERR! A complete log of this run can be found in: npm ERR!
/Users/bhanukaisuru/.npm/_logs/2019-05-01T05_42_52_916Z-debug.log

package.json file

{
  "name": "shopping-cart-admin-panel",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "axios": "^0.18.0",
    "bootstrap": "^4.3.1",
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "react-router-dom": "^5.0.0",
    "react-scripts": "3.0.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "proxy": "http://localhost:3000"
}

2 Answers

I can see you do have "start" script in your package.json

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

react-scripts is a set of scripts from the create-react-app starter pack.

You need to run npm start command in your terminal in order to run the app.

In common apps, the start script looks like so:

"start": "npx node index.js"

Where index.js can be also the server.js file

like image 153
Tomer Avatar answered Sep 11 '26 02:09

Tomer


it is because of global installation of create-react-app or your node.js is not updated.follow the below steps

  1. uninstall react from global

    ----> npm uninstall -g create-react-app

  2. Then try to update the npm and all the packages.

    ----> npm install -g npm@latest

  3. Now create your new react app

    ----> npx create-react-app yout-app-name

like image 42
saikumar yerra - sky Avatar answered Sep 11 '26 02:09

saikumar yerra - sky



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!