Node.js React本机捆绑包错误:Haste模块映射中不存在模块“scheduler”

Node.js React本机捆绑包错误:Haste模块映射中不存在模块“scheduler”,node.js,reactjs,react-native,npm,Node.js,Reactjs,React Native,Npm,在我的react原生项目中,如果我运行bundling命令,它将失败,并出现上述错误 命令: `sudo react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/` 错误: error Unable

在我的react原生项目中,如果我运行bundling命令,它将失败,并出现上述错误

命令:

`sudo react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/`
错误:

error Unable to resolve module 'scheduler' from '/home/buddhi/Buddhi/my-dev-environment/html/react-apps/mobile-64/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js': Module 'scheduler' does not exist in the Haste module map

This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  1. Clear watchman watches: 'watchman watch-del-all'.
  2. Delete the 'node_modules' folder: 'rm -rf node_modules && npm install'.
  3. Reset Metro Bundler cache: 'rm -rf /tmp/metro-bundler-cache-*' or 'npm start -- --reset-cache'.
  4. Remove haste cache: 'rm -rf /tmp/haste-map-react-native-packager-*'.. Run CLI with --verbose flag for more details.
版本:

  • “反应”:“16.8.3”
  • “反应本机”:“0.59.0”
  • “npm”:6.9.0
  • “节点”:10.16.0
当我使用react native 0.57.2运行相同的命令时,它可以完美地运行。(注意,我需要使用react原生版本0.59.0来获得应用程序的android x64架构支持)

  • 我在错误中尝试了上述步骤
  • 我尝试过多次删除
    /node\u模块
    npm安装
  • npm启动后尝试--重置缓存
  • 问题仍然存在

    我可以看到的变化是,在react原生版本0.59.0中,在文件
    ReactNativeRenderer-prod.js
    中有一行
    var scheduler=require(“scheduler”)
    ,如错误中所述。但在react原生版本0.57.2中未使用它

    我很确定这是由npm引起的,而不是react本机版本的问题。是吗

    无法理解为什么它不在提到的Haste模块图中,Haste模块图到底是什么?我找不到足够的信息来支持这个问题


    谢谢你的帮助。询问更多信息。

    如果您正在使用expo,请确保您的
    expo
    react native
    版本如下:

    “世博会”:“^35.0.0”,
    “反应”:“16.8.3”,
    “反应本机”:https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz“,


    只有这种组合对我有效

    嘿,你仍然有这个问题吗?是的,但我通过将依赖项逐个迁移到工作副本来解决它。但是对于我来说,这个问题没有解决方案。在我的例子中,我有一个遗留的
    rn cli.config.js
    文件。删除它并将其内容添加到metro conf中。就是这样。这可能是缓存问题吗,我正在处理这个问题,但仍然不知道确切的问题是什么。很抱歉,我不能向任何人推荐使用确切的版本。他们将永远无法升级。