在运行ReactNative Android应用程序时获取以下Exception以及Bundle时,获得相同的异常。
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android / app / src / main / assets / index.android.bundle --assets-dest android /应用程序/ SRC /主/ RES /
无法从DatePickerIOS
解析模块Project_Path/node_modules/react-native/Libraries/react-native/react-native-implementation.js
:Haste模块地图中不存在模块DatePickerIOS
的package.json: "依赖":{ "反应":" 16.3.1", "反应原生":" 0.55.2", " react-native-calendars":" 1.17.7", " react-native-carousel-view":" 0.5.1", " react-native-confirmation-code-input":" 1.0.4", " react-native-dash":" 0.0.8", " react-native-elements":" 0.19.1", " react-native-fbsdk":" 0.7.0", " react-native-google-places-autocomplete":" 1.3.6", " react-native-google-sign-in":" 1.0.16", " react-native-i18n":" 2.0.12", "反应原生指标":" 0.12.0", " react-native-maps":" 0.21.0", " react-native-material-bottom-navigation":" 0.9.0", " react-native-material-dropdown":" 0.11.1", " react-native-material-ui":" 1.22.1", " react-native-modalbox":" 1.4.2", " react-native-searchbar":" 1.14.0", " react-native-sensitive-info":" 5.1.0", " react-native-splash-screen":" 3.0.6", " react-native-vector-icons":" 4.6.0", " react-navigation":" 1.5.11", " react-native-tab-view":" 0.0.77", " react-native-global-props":" 1.1.3" }
答案 0 :(得分:18)
在Metro Bundler终端窗口中终止该过程,然后按照评论中的指示运行npm start -- --reset-cache
答案 1 :(得分:1)
我为这个问题发生了什么事,
我两次遇到这个问题,
我第一次在未安装js包时错误地导入了js包,它通过删除该错误的import语句解决了
第二次我尝试安装“ react-native-modal-overlay”软件包,而不是使用npm install,而是使用yarn添加react-native-modal-overlay,
和我开始遇到这个问题
尝试了我可以在网上找到的所有步骤,但是没有解决,最后,我在另一个软件包中重新安装了存储库,-----然后构建失败,t
-然后我运行了npm cache clean,(结果要求运行命令'npm install --cache / tmp / empty-cache' -我运行了此命令,然后尝试使其成功构建
答案 2 :(得分:0)
如果上面接受的答案在这种情况下不起作用。只需使用
npm install DatePickerIOS
任何lib都可能出现上述问题,然后只需使用
npm install "Error module name"