Tell us which versions you are using:
everything works fine
error:
Failed to build DependencyGraph: @providesModule naming collision:
Duplicate module name: react-native-packager
Paths: $$$$/node_modules/react-native-router-flux/node_modules/react-native/packager/package.json collides with $$$$$$/node_modules/react-native/packager/package.jsonThis error is caused by a @providesModule declaration with the same name across two different files.
Error: @providesModule naming collision:
Duplicate module name: react-native-packager
Paths: $$$$$$$$/node_modules/react-native-router-flux/node_modules/react-native/packager/package.json collides with $$$$$$$/node_modules/react-native/packager/package.json
In the mean-time you can remove react-native from the node_modules folder in react-native-router-flux. however ultimately the example dependencies should be removed from the module and added to the examples package.json
Thx @ChristianTucker This helped!
PR sent
I have tried to remove them and move them to devDependencies and peerDependencies, but I got the following errors
FAIL __tests__/xxx-test.js
โ Test suite failed to run
ENOENT: no such file or directory, stat '{projectDir}/node_modules/react-native-router-flux/node_modules/react-native/Libraries/Core/ErrorUtils.js'
at Error (native)
at Object.fs.statSync (fs.js:1000:11)
at Object.statSync (node_modules/graceful-fs/polyfills.js:297:22)
at Object.<anonymous> (node_modules/react-native/jest/setup.js:64:532)
Am I missing something here? I don't understand how it is trying to find react-native under react-native-router-flux
EDIT
If you run into this issue, clear the cache of Jest by running jest --no-cache, I can't believe I waste few hours on this one..
Also is React a needed dependency? It caused me react-ref-owner-error, removed it seems to fix it.
npm i [email protected] --savenpm cache cleanreact-native run-ios+1
Most helpful comment
In the mean-time you can remove react-native from the node_modules folder in react-native-router-flux. however ultimately the example dependencies should be removed from the module and added to the examples package.json