Cannot run example on android: Unable to resolve module `react-native-snap-carousel`
See original GitHub issueIs this a bug report, a feature request, or a question?
Question
Have you followed the required steps before opening a bug report?
- I have read the guidelines regarding bug report.
- I have reviewed the documentation in its entirety, including the dedicated documentations π.
- I have searched for existing issues and made sure that the problem hasnβt already been reported.
- I am using the latest plugin version.
- I am following the issue template closely in order to produce a useful bug report.
Have you made sure that it wasnβt a React Native bug?
yes
Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?
Android
Is the bug reproductible in a production environment (not a debug one)?
In an emulator, I didnβt went that far to tell itβs production
Environment
Emulator
Expected Behavior
I expect to run the examples on android
Actual Behavior
Right after cloning the master
branch, running npm run android
produce the following
dka@dka:[~/workspace/github.com/archriss/react-native-snap-carousel/example (master)]: npm run start
> example@0.61.5 start /home/dka/workspace/github.com/archriss/react-native-snap-carousel/example
> react-native start
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β Running Metro Bundler on port 8081. β
β β
β Keep Metro running while developing on any JS projects. Feel free to β
β close this tab and run your own Metro instance if you prefer. β
β β
β https://github.com/facebook/react-native β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Looking for JS files in
/home/dka/workspace/github.com/archriss/react-native-snap-carousel/example
Loading dependency graph, done.
To reload the app press "r"
To open developer menu press "d"
info Reloading app...
error: bundling failed: Error: Unable to resolve module `react-native-snap-carousel` from `src/index.js`: react-native-snap-carousel could not be found within the project.
If you are sure the module exists, try these steps:
1. Clear watchman watches: watchman watch-del-all
2. Delete node_modules: rm -rf node_modules and run yarn install
3. Reset Metro's cache: yarn start --reset-cache
4. Remove the cache: rm -rf /tmp/metro-*
at ModuleResolver.resolveDependency (/home/dka/workspace/github.com/archriss/react-native-snap-carousel/example/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:186:15)
at ResolutionRequest.resolveDependency (/home/dka/workspace/github.com/archriss/react-native-snap-carousel/example/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
at DependencyGraph.resolveDependency (/home/dka/workspace/github.com/archriss/react-native-snap-carousel/example/node_modules/metro/src/node-haste/DependencyGraph.js:282:16)
at Object.resolve (/home/dka/workspace/github.com/archriss/react-native-snap-carousel/example/node_modules/metro/src/lib/transformHelpers.js:267:42)
at /home/dka/workspace/github.com/archriss/react-native-snap-carousel/example/node_modules/metro/src/DeltaBundler/traverseDependencies.js:426:31
at Array.map (<anonymous>)
at resolveDependencies (/home/dka/workspace/github.com/archriss/react-native-snap-carousel/example/node_modules/metro/src/DeltaBundler/traverseDependencies.js:423:18)
at /home/dka/workspace/github.com/archriss/react-native-snap-carousel/example/node_modules/metro/src/DeltaBundler/traverseDependencies.js:275:33
at Generator.next (<anonymous>)
at asyncGeneratorStep (/home/dka/workspace/github.com/archriss/react-native-snap-carousel/example/node_modules/metro/src/DeltaBundler/traverseDependencies.js:87:24)
BUNDLE [android, dev] ./index.js ββββββββββββββββ 16.0% (2/94)::ffff:127.0.0.1 - - [07/Apr/2020:17:23:51 +0000] "GET /index.bundle?platform=android&dev=true&minify=false HTTP/1.1" 500 - "-" "okhttp/3.12.1"
BUNDLE [android, dev] ./index.js ββββββββββββββββ 16.0% (2/94), failed.
Reproducible Demo
The examples
directory of this repository
Steps to Reproduce
git clone https://github.com/archriss/react-native-snap-carousel.git
cd react-native-snap-carousel
npm i
cd example
npm i
npm run start
# press r
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11
Top Results From Across the Web
react native import Carousel from "react-native-snap-carousel ...
I only install npm install --save @types/react-native-snap-carousel. because i use typeScript... But i must install
Read more >requiring module "node_modules/react-native-snap-carousel ...
Cannot run example on android: Unable to resolve module `react-native ... Github.com > meliorence > react-native-snap-carousel. To reload the app press " rΒ ......
Read more >Build and run your app - Android Developers
It indicates that the Android Studio IDE can't resolve symbols between the variants of the selected modules. For example, if you have a...
Read more >react-native-snap-carousel - npm
Compatible with Android & iOS.. Latest version: 3.9.1, last published: 3 years ago. Start using react-native-snap-carousel in your projectΒ ...
Read more >React Native carousel with react-native-snap-carousel
Create a carousel in a React Native mobile application with a Tinder-style swipe animation using the react-native-snap-carousel package.
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
yarn add react-native-snap-carousel @types/react-native-snap-carousel
two packages, both
It seems to work with
yarn
instead ofnpm
(I can reproduce the issue withnpm
). Donβt know the reason yetI tried to change the exampleβs package.json on
"react-native-snap-carousel": "file:../"
to"react-native-snap-carousel": "3.9.0"
in this cae, it can work withnpm install
andnpm run android
. So I think it might relate to the local package and npm.