react-native-linear-gradient: error: bundling failed: Error: Unable to resolve module `./nativeLinearGradient`
I was trying to update from RN 0.57.0 to 0.58.4, I have this error thrown by bundler
error: bundling failed: Error: Unable to resolve module `./nativeLinearGradient` from `/Users/apple/Projects/trials/yollaapp/node_modules/react-native-linear-gradient/index.android.js`: The module `./nativeLinearGradient` could not be found from `/Users/apple/Projects/trials/yollaapp/node_modules/react-native-linear-gradient/index.android.js`. Indeed, none of these files exist:
* `/Users/apple/Projects/trials/yollaapp/node_modules/react-native-linear-gradient/nativeLinearGradient(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
* `/Users/apple/Projects/trials/yollaapp/node_modules/react-native-linear-gradient/nativeLinearGradient/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
at ModuleResolver.resolveDependency (/Users/apple/Projects/trials/yollaapp/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:163:15)
at ResolutionRequest.resolveDependency (/Users/apple/Projects/trials/yollaapp/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
at DependencyGraph.resolveDependency (/Users/apple/Projects/trials/yollaapp/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph.js:273:16)
at Object.resolve (/Users/apple/Projects/trials/yollaapp/node_modules/react-native/node_modules/metro/src/lib/transformHelpers.js:261:42)
at dependencies.map.result (/Users/apple/Projects/trials/yollaapp/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:391:31)
at Array.map (<anonymous>)
at resolveDependencies (/Users/apple/Projects/trials/yollaapp/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:388:18)
at /Users/apple/Projects/trials/yollaapp/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:261:33
at Generator.next (<anonymous>)
at asyncGeneratorStep (/Users/apple/Projects/trials/yollaapp/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:87:24)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 6
- Comments: 15 (2 by maintainers)
Iām using 0.58.4 here and it works fine. Try deleting
node_modulesand installing it again, also clear cache.Unable to resolve module
./nativeLinearGradientStill exists in 0.58.6@Ananthakr please consider re-opening, issue is persistent in react-native 0.59.x
this issue is still persisting on react 0.59.9. is there any solution other than using yarn?
Using yarn fixed it.
This is the weirdest thing ever. I just used
yarn installinstead ofnpm installand that fixed it for me? ??