2

运行后在 reactJs 中

npm 开始

它给

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

错误。

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

1 回答 1

5

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

于 2018-10-06T02:34:18.917 回答