7

When I install NativeBase and React-Native-Router-Flux in my react-native project I get this error:

Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: react-native-vector-icons
  Paths: /Users/vittori/Desktop/repos/GitHubExamples/native-starter-kit/node_modules/react-native/local-cli/core/__fixtures__/files/package.json collides with /Users/vittori/Desktop/repos/GitHubExamples/native-starter-kit/node_modules/react-native-router-flux/node_modules/react-native/local-cli/core/__fixtures__/files/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-vector-icons
  Paths: /Users/vittori/Desktop/repos/GitHubExamples/native-starter-kit/node_modules/react-native/local-cli/core/__fixtures__/files/package.json collides with /Users/vittori/Desktop/repos/GitHubExamples/native-starter-kit/node_modules/react-native-router-flux/node_modules/react-native/local-cli/core/__fixtures__/files/package.json

This error is caused by a @providesModule declaration with the same name across two different files.
    at HasteMap._updateHasteMap (/Users/vittori/Desktop/repos/GitHubExamples/native-starter-kit/node_modules/react-native/packager/src/node-haste/DependencyGraph/HasteMap.js:159:13)
    at p.getName.then.name (/Users/vittori/Desktop/repos/GitHubExamples/native-starter-kit/node_modules/react-native/packager/src/node-haste/DependencyGraph/HasteMap.js:134:31)
David Vittori
  • 1,146
  • 1
  • 13
  • 30
  • I'm having the same exact problem arise when starting with `react-native start`. Running `npm i` does have some warnings for react-dom, react-native, react-native-maps, react-native and react-static-container requiring a peer of react. I've tried many things such as cleaning the npm cache, deleting node_modules, upgrading using react-native. Let me know how you get on :) – Michael Apr 21 '17 at 14:39

4 Answers4

6

Solution was posted here

yarn add react-native-router-flux@3.38.0

Tony
  • 214
  • 2
  • 3
0

You should be able to update react-native-router-flux using: npm i react-native-router-flux --save

It may be that trying to start the react-native packager fails again and running may be useful:

1. Clear watchman watches: `watchman watch-del-all`. 2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`. 3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start --reset-cache`.

You may see once attempting to run the packager again errors such as:

Failed to build DependencyGraph: @providesModule naming collision: Duplicate module name

You may need to run the npm install for react-native-router-flux again.

Michael
  • 591
  • 8
  • 24
  • Tried these instructions 3 times with a fresh codebase. Also tried clearing everything out and using `yarn.` Same errors occur – Tony Apr 21 '17 at 18:44
0

If you work with yarn, please run this command. yarn add react-native-router-flux@3.38.0

And if you work with npm, please run this command. npm install react-native-router-flux@3.38.0 --save

Also you still get the issue, please downgrade react-native version to 0.41.2.

Then, it will work.

fcemmon
  • 1
  • 3
0

NativeBase 2.1.4 solves this issue

Supriya Kalghatgi
  • 1,155
  • 9
  • 10