Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix Unable to resolve "react-native-screens" from "node_modules\react-navigation-stack\lib\module\views\StackView\StackViewCard.js"?

I used below command for react app routes.

npm i react-native-router-flux --save

Then i restart npm by "npm start" and get this error

Unable to resolve "react-native-screens" from "node_modules\react-navigation-stack\lib\module\views\StackView\StackViewCard.js" Failed building JavaScript bundle.

How can fix this error? I also updated npm.

This is package.json file

         {
          "main": "node_modules/expo/AppEntry.js",
          "scripts": {
          "start": "expo start",
          "android": "expo start --android",
          "ios": "expo start --ios",
          "web": "expo start --web",
          "eject": "expo eject"
         },
         "dependencies": {
           "expo": "~36.0.0",
           "react": "~16.9.0",
           "react-dom": "~16.9.0",
           "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz",
           "react-native-router-flux": "^4.2.0",
           "react-native-web": "~0.11.7"
          },
          "devDependencies": {
            "babel-preset-expo": "~8.0.0",
            "@babel/core": "^7.0.0"
           },
          "private": true
          }
like image 469
Ehsan ul haq Avatar asked Aug 07 '26 00:08

Ehsan ul haq


2 Answers

I used react native official navigation. It really helpful and easy to use. Visit https://facebook.github.io/react-native/docs/navigation

like image 199
Ehsan ul haq Avatar answered Aug 09 '26 13:08

Ehsan ul haq


I had the same issue. Noticed that package.json in the repo is missing react-native-screens from the dependencies.

npm i react-native-screens

like image 29
mohamed amine salah Avatar answered Aug 09 '26 14:08

mohamed amine salah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!