1
votes

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" } }

3
Post your package.json - Phix

3 Answers

1
votes

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"
    ]
  }
}
0
votes

You should add something like this in your package.json

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

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" } }