Unable to resolve path to module 'react-native-screens' (ESLint)
See original GitHub issueGot this lint error in my VS Code:
Unable to resolve path to module 'react-native-screens'.eslint(import/no-unresolved)
module "react-native-screens"
Issue Analytics
- State:
- Created 5 years ago
- Reactions:13
- Comments:9
Top Results From Across the Web
Unable to resolve path to module 'react-native-screens' ...
You need to install 3 more libs react-native-gesture-handler, react-native-reanimated, and react-native-screens in order to work with ...
Read more >eslint/eslint - Gitter
I'm trying to setup eslint-plugin-import but I can't make it work xD ... 6:8 error Unable to resolve path to module '~/components' import/no-unresolved....
Read more >unable to resolve module react-native-screens
Unable to resolve path to module 'react-native-screens'.eslint(import/no-unresolved) module "react-native-screens". Open side panel.
Read more >[Solved]-Unable to resolve path to module 'react-native- ...
Coding example for the question Unable to resolve path to module 'react-native-screens' (ESLint)-React Native.
Read more >ESLint Unable to resolve path to module
Visual Studio 2022 shows errors for tsconfig paths when it's actually ... (ESLint) import/no-unresolved Unable to resolve path to module ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I fixed this issue by adding the extension
.native.js
to the eslint-import-resolver-node config in my .eslintrc file:Explanation: The idea comes from benmosher’s comment at eslint-plugin-import. In my case,
[".js", ".jsx", ".json"]
is the default configuration for the node resolver extensions; this can be found out e.g. by runningeslint --print-config index.js
. (The eslint-import-resolver-node extensions for the default airbnb config are defined in eslint-config-airbnb/rules/react.js as['.js', '.jsx', '.json']
; eslint-config-airbnb adds rules for React by default: eslint-config-airbnb/index.js.) react-native-screens sets src/screens as main entry point in the package.json file. In the src-folder screens.native.js is the correct entry point for react-native, so adding.native.js
to the list of resolver extensions fixes the problem.I resolve that error by simply npm install react-native-screens