我正在尝试运行使用 Metro Bundler 的现有 React Native 项目。我的操作系统是 Ubuntu 20.04,我尝试在物理 Android 设备和使用 Android Studio 创建的 Android 模拟器上运行该应用程序。
我已经成功克隆了项目的 repo,安装了它的依赖项(yarn
),构建了应用程序(react-native run-android
),并在我的手机和模拟器上打开了应用程序。但是,运行react-native start
错误说TypeError: cb.apply is not a function
。这是我在运行时得到的完整信息和错误react-native start
:
$ react-native start
warn Your project is using deprecated "rnpm" config that will stop working from next release. Please use a "react-native.config.js" file to configure the React Native CLI. Migration guide: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
warn The following packages use deprecated "rnpm" config that will stop working from next release:
- rn-fetch-blob: https://npmjs.com/package/rn-fetch-blob
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
┌──────────────────────────────────────────────────────────────────────────────┐
│ │
│ Running Metro Bundler on port 8081. │
│ │
│ Keep Metro running while developing on any JS projects. Feel free to │
│ close this tab and run your own Metro instance if you prefer. │
│ │
│ https://github.com/facebook/react-native │
│ │
└──────────────────────────────────────────────────────────────────────────────┘
warn Your project is using deprecated "rnpm" config that will stop working from next release. Please use a "react-native.config.js" file to configure the React Native CLI. Migration guide: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
warn The following packages use deprecated "rnpm" config that will stop working from next release:
- rn-fetch-blob: https://npmjs.com/package/rn-fetch-blob
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
Looking for JS files in
/home/ggiuffre/Documents/squib/app
Loading dependency graph, done.
BUNDLE [android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1)/home/ggiuffre/Documents/squib/app/node_modules/@react-native-community/cli/node_modules/graceful-fs/polyfills.js:285
if (cb) cb.apply(this, arguments)
^
TypeError: cb.apply is not a function
at /home/ggiuffre/Documents/squib/app/node_modules/@react-native-community/cli/node_modules/graceful-fs/polyfills.js:285:20
at FSReqCallback.oncomplete (fs.js:169:5)
安装graceful-fs
(正如另一篇关于同一问题的帖子所建议的那样)并没有改变任何东西,我仍然得到同样的错误。
这里可能是什么问题?提前致谢。