0
~ soli$ cd react-app
react-app soli$ npm start
npm ERR! missing script: start

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/soli/.npm/_logs/2021-06-29T05_14_55_880Z-debug.log
Surjeet Bhadauriya
  • 6,755
  • 3
  • 34
  • 52

1 Answers1

0

It appears that you might not have start script in your react package.json file or maybe you happen to rename the server.js file with something else.

By default If there is a server.js file in the root of your package, then npm will default the start command to node server.js.

Possible ways to tackle this can be either any one of them -

  1. Rename the server script file to server.js.
  2. Add this piece of code in package.json
"scripts": {
    "start": "node your-script.js"
}

Also what you can try is to run this directly-

node script-file-name.js
Harshit
  • 88
  • 1
  • 7