npm ERR! missing script: start npm ERR! A complete log of this can be found in: npm ERR! C:\Users\hp\AppData\Roaming\npm-cache_logs\2020-09-04T05_37_54_043Z-debug.log
Asked
Active
Viewed 182 times
0
-
answer it this ask: https://stackoverflow.com/questions/31976722/start-script-missing-error-when-running-npm-start – Md. Abu Sayed Sep 04 '20 at 06:01
1 Answers
0
Check your package.json
and make sure there is a start
key under your scripts
. If there isn't any then you need to make sure that there is a server.js
file in your root folder. If none of this applies then npm start
won't work.
Per npm docs,
This runs an arbitrary command specified in the package’s "start" property of its "scripts" object. If no "start" property is specified on the "scripts" object, it will run node server.js.
resource: https://docs.npmjs.com/cli/start.html

Edward Romero
- 2,905
- 1
- 5
- 17
-
initially when i installed the npm , it started successfully, now there are two package.json files 1) In this, it has "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, – 2) "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, I applied the "start" in this too. But it's not working – Sumedh Mahajan Sep 04 '20 at 07:00
-
@SumedhMahajan there should only be one. Can you share your directory structure by running `ls` inside your root directory. Also, it would be good if you can add to the question a copy of the `scripts` in your package.json file so that we can better see what you're using. Right now we don't know the type of project. you're trying to build so we are answering the question in a generic way. – Edward Romero Sep 04 '20 at 07:05
-
ls ->my-app d----- 04-09-2020 12:24 node_modules d----- 28-04-2019 16:28 setup-files-react-beach-resort-master -a---- 28-04-2019 16:28 9301 App.css -a---- 28-04-2019 16:28 21879 data.js -a---- 04-09-2020 10:59 6650 package-lock.json -a---- 04-09-2020 12:26 317 package.json -a---- 20-07-2020 23:12 1895481 setup-files-react-beach-resort-master.zip – Sumedh Mahajan Sep 04 '20 at 07:15
-
{ "name": "json", "version": "1.0.0", "description": "", "main": "data.js", "dependencies": { "react-icons": "^3.10.0", "react-router-dom": "^5.2.0" }, "devDependencies": {}, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC" } – Sumedh Mahajan Sep 04 '20 at 07:16
-
{ "name": "my-app", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.5.0", "@testing-library/user-event": "^7.2.1", "react": "^16.13.1", "react-dom": "^16.13.1", "react-scripts": "3.4.1" }, "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%", – Sumedh Mahajan Sep 04 '20 at 07:17
-
ok that's the issue right there. Not sure how you are able to have two package.json files in the same directory but anyways. You only need to have the package.json `"name": "my-app"` That is the one with the scripts that contains `"start"` which is the one you want – Edward Romero Sep 04 '20 at 07:18
-
-
Hey there thank u so much , may be its was just a silly thing , yours was truly correct but i had done a silly mistake that is I didn't use the correct path for that in which the actual package.json exists ,Haha ,Apologise for the trouble and thanks , I owe you one :-) – Sumedh Mahajan Sep 04 '20 at 08:52