6

I am learning react native. When installing the app in simulator, i am facing an issue which is following. Please provide any solution.

If i install react-native-pager-view then it throws error. And when i uninstalled it. It is throwing following error-:

   Unable to resolve module react-native-pager-view in the root directory.

enter image description here

Rakesh Saini
  • 660
  • 2
  • 7
  • 20
  • I have absolutely the same problem for 2 days, I managed to solve it yesterday with this solution: https://stackoverflow.com/a/63136085/9300663 . Then today I installed a new package and the problem returned. I keep investigating this issue, but we'll maybe have to open an issue on the react-native-pager-view repo... – XplosiVe06 Sep 22 '21 at 17:03

4 Answers4

6

I've solved this issue by running:

yarn add react-native-pager-view 
ElManini
  • 81
  • 6
1

Try running this command:

rm -rf yarn.lock node_modules ios/Pods ios/Podfile.lock && yarn install && cd ios && pod install && cd ..
Thanh Chương
  • 160
  • 1
  • 5
0

I solved this problem by doing pod install and removing some other dependencies. I install and uninstall this dependency several times. Finally i deleted this and at last it works. Restart vs code.

Rakesh Saini
  • 660
  • 2
  • 7
  • 20
0

I think you're using material top tab navigation from react-navigation, and this requires some extra dependencies which you need to install before using react-navigation

for ref please visit react navigation official site.

To fix this, please run yarn add react-native-tab-view react-native-pager-view and then pod install

may be your problem will solve.

M.Daniyal Aslam
  • 489
  • 6
  • 6