1

After creating a new ReactJS app using npx create-react-app testapp, the command npm start (or any other npm-script) doesn't work in ANY of my react projects. It gives no output to console, and the log files in ~/.npm/_logs/ have nothing related to the start command.

Things I have tried:

  • upgrading nodejs and npm
  • deleting package-lock.json and node_modules/ and running npm install (which works just fine, but doesn't solve the issue with npm start)
  • restarting the kernel (5.3.12-arch1-1)

Additional info:

node -v = 13.3.0

npm -v = 16.13.1

Here is package.json from the most recently created app:

{
  "name": "react-frontend",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "@testing-library/user-event": "^7.1.2",
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "react-scripts": "3.3.0"
  },
  "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%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}
jww
  • 97,681
  • 90
  • 411
  • 885
ad_intra
  • 93
  • 8
  • 2
    Does this answer your question? [NPM run \* doesn't do anything](https://stackoverflow.com/questions/59016328/npm-run-doesnt-do-anything) – RobC Dec 10 '19 at 10:15

1 Answers1

5

Found the solution. npm had been configured to ignore scripts.

Running npm config set ignore-scripts false fixed the problem.

ad_intra
  • 93
  • 8