admin管理员组文章数量:1287818
I used below mand 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": ".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
}
I used below mand 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./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
}
Share
Improve this question
asked Feb 20, 2020 at 21:03
Ehsan ul haqEhsan ul haq
1071 silver badge9 bronze badges
7 Answers
Reset to default 2I used react native official navigation. It really helpful and easy to use. Visit https://facebook.github.io/react-native/docs/navigation
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
This is because of the new react-navigation changes. Doing a npm install right now is installing the latest versions instead of the previous versions
You should clear the cache by removing node_module
, .expo
and package-lock.json
and then reinstall all the packages and start the project by using the following mand: expo r -c
which should reset the cache and make the project work again as intended.
More Info
Installing following two,
npm install --save @react-native-munity/masked-view
npm install react-native-safe-area-context
it is work for me
or use,
npm install @react-navigation/native
for install 'react-navigation'
I got a similar error after upgrading from React Navigation V3 to V4.
Simply doing
npm i react-native-screens
solved the problem for me.
Install the following dependencies.
@react-native-munity/masked-view
react-native-safe-area-context
expo install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-munity/masked-view
本文标签:
版权声明:本文标题:javascript - How to fix Unable to resolve "react-native-screens" from "node_modulesreact-navigation-s 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741326545a2372516.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论