无法解析模块“react-native-reanimated" [英] Unable to resolve module `react-native-reanimated`

查看:41
本文介绍了无法解析模块“react-native-reanimated"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一旦我使用

npm install --save react-navigation-tab

节点终端出现以下错误.

The following error occure on node terminal.

React-tab-navigation 抛出以下错误.

React-tab-navigation throwing the following error.

错误:捆绑失败:错误:无法从 node_modules\react-navigation-tabs\lib\module\views\MaterialTopTabBar.jsreact-native-reanimated>: 在项目中找不到 react-native-reanimated.

error: bundling failed: Error: Unable to resolve module react-native-reanimated from node_modules\react-navigation-tabs\lib\module\views\MaterialTopTabBar.js: react-native-reanimated could not be found within the project.

推荐答案

react-navigation-tabs 依赖于 react-navigation 包.
所以我认为您错过了入门部分.

react-navigation-tabs depends on react-navigation package.
So I think you missed the Getting Started section.

目前对于 react-navigation 4.x 你应该:

Currently for react-navigation 4.x you should:

yarn add react-navigation
yarn add react-native-reanimated react-native-gesture-handler react-native-screens@^1.0.0-alpha.23

然后对于ios:

cd ios
pod install

要完成为 Android 安装 react-native-screens,请将以下两行添加到 android/app/build.gradle 中的依赖项部分:

To finalize installation of react-native-screens for Android, add the following two lines to dependencies section in android/app/build.gradle:

implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'

然后

react-native link react-native-reanimated

这篇关于无法解析模块“react-native-reanimated"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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