gpt4 book ai didi

react-native - 尝试创建发布包时无法解析模块 'AccessibilityInfo'

转载 作者:行者123 更新时间:2023-12-03 08:50:16 33 4
gpt4 key购买 nike

我在运行

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 react-native@0.55.4
react-native run-android
npm install --save babel-core@latest babel-loader@latest
npm uninstall --save babel-preset-react-native
npm install --save babel-preset-react-native@4.0.0
react-native run-android

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

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com