无法从“node_modules\react-redux\lib\index.js”解析“./utils/batch”

MAg*_*ram 5 reactjs react-native react-redux expo

当我开始使用 React Redux 时出现此错误,我尝试了在网上找到的所有解决方案,但没有任何结果

更改react和react redux版本我安装了计划,react 16.5 with redux 6.0.0 =无react 16.8.6 with redux 6.0.0或6.0.1或7.0.2 =无

"dependencies": {
    "expo": "^32.0.6",
    "prop-types": "^15.7.2",
    "react": "^16.8.6",
    "react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
    "react-redux": "^6.0.0",
    "react-saga": "^0.3.1",
    "react-thunk": "^1.0.0",
    "redux": "^4.0.1",
    "redux-saga": "^1.0.2"
  },
  "devDependencies": {
    "schedule": "^0.4.0"
  },
Run Code Online (Sandbox Code Playgroud)

Ema*_*aid 5

找到解决方案这是因为您可能在该文件夹名称的 node_modules 中安装了先前版本的react-redux。而不是expo startnpm start。tryexpo r -c 这会删除该目录的 expo 中的缓存。找到这个答案真是太痛苦了。