简体   繁体   中英

'react' - After run npm start it gives ./src/index.js Module not found: Can't resolve 'react' in 'C:\Users\...\src' error

In reactJs after run

npm start

it gives

./src/index.js Module not found: Can't resolve 'react' in 'C:\\Users...\\src'

error.

this is my package.js

{
  "name": "client-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@aspnet/signalr": "^1.0.4",
    "react": "^16.5.2",
    "react-dom": "^16.5.2",
    "react-scripts": "^1.1.5"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

尝试删除package-lock.json ,运行npm install然后再次运行npm start

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