简体   繁体   中英

error with npm start after create-react-app

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: 错误

错误

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM