尝试创建发布包时无法解析模块“AccessibilityInfo" [英] Unable to resolve module 'AccessibilityInfo', when trying to create release bundle

查看:20
本文介绍了尝试创建发布包时无法解析模块“AccessibilityInfo"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在跑步

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/

创建发布包的命令,但出现以下错误

command to create release bundle, but I am getting following error

Unable to resolve module `AccessibilityInfo` from `C:Usersgodha.pranayproject
ode_modules
eact-nativeLibraries
eact-native
eact-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-*`.

我尝试了互联网上推荐的所有方法,但没有任何效果.我完全坚持它.请帮忙.

I tried everything recommended on internet, nothing is working. I am totally stuck on it. Please help.

推荐答案

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

It seems like a bug in 0.56 related to dependencies. The "solution" is to find the correct combination of dependencies' versions. We found a workaround by installing those versions EXACTLY:

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

所以你必须按顺序运行这些命令:

So you have to run those commands in order:

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

这篇关于尝试创建发布包时无法解析模块“AccessibilityInfo"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆