1

I am new to React.js. And I followed the tutorials in https://github.com/facebook/create-react-app. It worked fine while running npm init react-app my-app. But I got error when I run npm start.

detailed error message: error

error

I have tried https://stackoverflow.com/questions/39959900/npm-start-error-with-create-react-app. That dose not work for me. I also tried move my project folder to upper directory, which still doesn't work.....

Can anyone fix it?

add: package.json

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.5.2",
    "react-dom": "^16.5.2",
    "react-scripts": "2.0.5"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}
Harrymissu
  • 450
  • 2
  • 8
  • 18

1 Answers1

0

try npm install -g to update npm

then rm -rf node_modules to delete the existing modules

finally npm install install the new project dependencies

danday74
  • 52,471
  • 49
  • 232
  • 283