1

Here is what my command prompt shows me when I try typing "npm start":

┌──────────────────────────────────────────────────────────────────────────┐
│                         npm update check failed                          │
│                   Try running with sudo or get access                    │
│                   to the local update config store via                   │
│ sudo chown -R $USER:$(id -gn $USER) C:\Users\User's privacy\.config │
└──────────────────────────────────────────────────────────────────────────┘
npm ERR! missing script: start

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User's privacy\AppData\Roaming\npm-cache\_logs\2020-08-17T19_46_48_248Z-debug.log

could somebody please help me somehow?

Ah by the way here is my package.json file:

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

1
  • 1
    Post your package.json Commented Aug 17, 2020 at 19:51

3 Answers 3

1

I had the same issue, the problem was I was interrupting npm when it was loading the complete react project on my laptop, because it takes more than 5 minutes and I was not conscious of it. as a result,

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

was missing and a bunch of other things were too. if the project is completely loaded your package.json will appear like this:

{
  "name": "app0",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.11.9",
    "@testing-library/react": "^11.2.5",
    "@testing-library/user-event": "^12.7.1",
    "react": "^17.0.1",
    "react-dom": "^17.0.1",
    "react-scripts": "4.0.2",
    "web-vitals": "^1.1.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}
Sign up to request clarification or add additional context in comments.

Comments

0

You should add something like this in your package.json

  "scripts": {
    "start": "node index.js",
  },

Comments

0

In general, looking at the error will give you some details on what you need to do to resolve the issue. In this case, you have the error:

"npm ERR! missing script: start"

Which means node is looking for a start script. This means you need to add a script in the package.json file.

Something like this in your file:

"scripts": { "start" : "bar ./test" } }

4 Comments

I'm pretty new to this kind of stuff so I don't know how to even open my package.json file yet...
@VictorDeMelo Download a code editor (such as VS Code) and use that to open the package.json file. Then add a script as mentioned above.
Could you edit the json files on the question doc, when I put it on VS code
VS code is just a text editor. Think of it as 'fancier" notepad. You can edit text files using that program. Including json files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.