Unable to resolve module ../../package.json
See original GitHub issueDescribe the bug
Hello! I am quite new to React Native and trying to integrate Stripe using @stripe/stripe-react-native. After initializing the library following the installment guide on Stripe (https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=custom), I get the error below and not sure how to solve this (I don’t know if this is a bug or not).
Unable to resolve module ../../package.json from /Users/.../node_modules/@stripe/stripe-react-native/lib/commonjs/components/StripeProvider.js: None of these files exist: *node_modules/@stripe/stripe-react-native/lib/package.json
Versions
react: 17.0.2
react-native: 0.66.4
stripe-react-native: 0.2.3
babel: 7.12.9
running device: iOS 15 simulator
Also I am developing in React cli (not expo)
Is there anything else I need to integrate the library other than yarn add and pod install
? Any help would be much appreciated! Thanks a lot in advance!
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
Top Results From Across the Web
Unable to Resolve Module in React Native App - Stack Overflow
Unable to solve module 'module-name' is realated to the node modules packages and sometime you would need to ...
Read more >Issues - GitHub
Already tried everything from #770 but no success. error: Error: Unable to resolve module ../../package.json from ...
Read more >React Native, Typescript and VS Code: Unable to resolve ...
React Native, Typescript and VS Code: Unable to resolve module · Reset the tool that watches files for changes on disk: · Rebuild...
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
To fix the error, you need to install the package that is absent in your project directory – npm install package-name or yarn...
Read more >Troubleshooting | React Navigation
If the module points to an npm package (i.e. the name of the module doesn't with ./ ), then it's probably due to...
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 Free
Top 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
@alekhinen @jukaha
I am using https://github.com/apollographql/apollo-client for api client and added some changes to metro config referring to this change log. (https://github.com/apollographql/apollo-client/blob/main/CHANGELOG.md#apollo-client-354-2021-11-19).
However,
require("metro-config")
was looking at wrong path and causing this stripe error. So I corrected it to the right path which isrequire('metro-config/src/defaults/defaults')
.Hope this helps!
@jukaha @alekhinen I was able to find a workaround to this issue here hope it helps!