When I install a specific npm package to my react native project and attempt to run it i get the following error:
This error is caused by a @providesModule declaration with the same name accross two different files.
Error: @providesModule naming collision:
Duplicate module name: promiseRejectionIsError
Paths:
projectname/node_modules/react-native-stripe-api/node_modules/react-native/Libraries/promiseRejectionIsError.js collides with
projectname/node_modules/react-native/Libraries/promiseRejectionIsError.js
Problem: This package react-native-stripe-api
seems to be installing another react and react-native module which conflict with the over all project modules.
I think the reason for this is because a specific version of react and react-native modules are defined as a dependency in the react-native-stripe-api/package.json:
"dependencies": {
"babel-polyfill": "6.9.1",
"react": "15.1.0",
"react-native": "0.27.2"
},
It seems like these should be removed.
Could someone with more knowledge about npm confirm this is actually the correct way of defining node dependencies. And the appropriate solution to resolve the problem.
Your assessment is correct
Could someone with more knowledge about npm confirm this is actually the correct way of defining node dependencies.
They should reference react
as a peerDependencies
And the appropriate solution to resolve the problem.
Quickfix: Delete the extra react version
Longfix: Submit a pull request with react as a peer dependency
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With