~ 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
Asked
Active
Viewed 32 times
0

Surjeet Bhadauriya
- 6,755
- 3
- 34
- 52
-
run `npm run start` instead of `npm start` – Gulam Hussain Jun 29 '21 at 05:20
-
Show your package.json – Surjeet Bhadauriya Jun 29 '21 at 05: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) – Ashok Kumar Thangaraj Jun 29 '21 at 05:23
1 Answers
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 -
- Rename the server script file to server.js.
- 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