question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot run example on android: Unable to resolve module `react-native-snap-carousel`

See original GitHub issue

Is this a bug report, a feature request, or a question?

Question

Have you followed the required steps before opening a 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.

image

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:open
  • Created 3 years ago
  • Reactions:2
  • Comments:11

github_iconTop GitHub Comments

1reaction
crastylecommented, Aug 3, 2021

yarn add react-native-snap-carousel @types/react-native-snap-carousel

two packages, both

1reaction
gie3dcommented, May 2, 2020

It seems to work with yarn instead of npm (I can reproduce the issue with npm). Don’t know the reason yet

git clone https://github.com/archriss/react-native-snap-carousel.git
cd react-native-snap-carousel
yarn
cd example
yarn
yarn android

I 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 with npm install and npm run android. So I think it might relate to the local package and npm.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found