React-native-router-flux: Duplicate module name: react-native-packager

Created on 21 Apr 2017  ยท  7Comments  ยท  Source: aksonov/react-native-router-flux

Version

Tell us which versions you are using:

  • react-native-router-flux v3.38.1
  • react-native v0.43.3

Expected behaviour

everything works fine

Actual behaviour

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.json

This 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

Steps to reproduce

  1. react-native init
  2. yarn add react-native-router-flux
  3. require this module
  4. build/run the application

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

All 7 comments

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.

  1. npm i [email protected] --save
  2. npm cache clean
  3. react-native run-ios

+1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xnog picture xnog  ยท  3Comments

kirankalyan5 picture kirankalyan5  ยท  3Comments

rafaelcorreiapoli picture rafaelcorreiapoli  ยท  3Comments

GCour picture GCour  ยท  3Comments

YouYII picture YouYII  ยท  3Comments