我在跑步

react-native bundle --platform windows --dev false --entry-file index.windows.js --bundle-output windows/app/ReactAssets/index.windows.bundle --assets-dest windows/app/ ReactAssets/

创建发布包的命令,但出现以下错误
Unable to resolve module `AccessibilityInfo` from `C:\Users\godha.pranay\project\node_modules\react-native\Libraries\react-native\react-native-implementation.js`: Module does not exist in the 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 $TMPDIR/react-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf $TMPDIR/haste-map-react-native-packager-*`.

我尝试了互联网上推荐的所有内容,但没有任何效果。我完全被卡住了。请帮忙。

最佳答案

似乎是与依赖项相关的0.56中的错误。 “解决方案”是找到依赖项版本的正确组合。通过完全安装这些版本,我们找到了一种解决方法:

react-native >> 0.55.4
babel-core >> latest
babel-loader >> latest
babel-preset-react-native >> 4.0.0

因此,您必须按顺序运行这些命令:
react-native init AwesomeProject
cd AwesomeProject
react-native run-android
npm uninstall react-native
npm install --save [email protected]
react-native run-android
npm install --save babel-core@latest babel-loader@latest
npm uninstall --save babel-preset-react-native
npm install --save [email protected]
react-native run-android

关于react-native - 尝试创建发行包时无法解析模块 'AccessibilityInfo',我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/48756550/

10-09 05:17