'react'-运行npm启动后,它给出./src/index.js找不到模块:无法解决'C:\ Users \ ... \ src'错误中的'react'

时间:2018-10-06 02:28:36

标签: reactjs npm-run

运行后在reactJs中

  

npm开始

给出

  

./ src / index.js找不到模块:无法解析“ react”   'C:\ Users ... \ src'

错误 这是我的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"
  }
}

1 个答案:

答案 0 :(得分:2)

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