react-native-router-flux: Duplicate versions of react-native being installed

react-native-router-flux v3.38.1 react-native v0.42.3

yarn install is causing react-native v0.42.3 and react-native v0.41.1 to be installed

Should react and react-native be installed as a peerDependency for react-native-router-flux?

To repro:

react-native init {projectName} --version=0.42.3 cd {projectName} yarn add react-native-router-flux npm start

You should see

Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: react-animated
  Paths: /Users/bdewitt/sandbox/break/node_modules/react-native-router-flux/node_modules/react-native/Libraries/Animated/release/package.json collides with /Users/bdewitt/sandbox/break/node_modules/react-native/Libraries/Animated/release/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-animated
  Paths: /Users/bdewitt/sandbox/break/node_modules/react-native-router-flux/node_modules/react-native/Libraries/Animated/release/package.json collides with /Users/bdewitt/sandbox/break/node_modules/react-native/Libraries/Animated/release/package.json

This error is caused by a @providesModule declaration with the same name across two different files.
    at HasteMap._updateHasteMap (/Users/bdewitt/sandbox/break/node_modules/react-native/packager/src/node-haste/DependencyGraph/HasteMap.js:158:13)
    at p.getName.then.name (/Users/bdewitt/sandbox/break/node_modules/react-native/packager/src/node-haste/DependencyGraph/HasteMap.js:133:31)

yarn add react-native-router-flux@3.38.0

Should succeed

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 53
  • Comments: 40 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Got wrecked by this too. Fixed with the rollback to 3.38.0

watchman watch-del-all
rm -rf node_modules && npm install
npm uninstall react-native-router-flux
npm install --save react-native-router-flux@3.38.0
rm -fr $TMPDIR/react-*
npm cache clean
npm start -- --reset-cache

reinstall 3.38.0 for now npm install --save react-native-router-flux@3.38.0

I’ve been tearing my hair out over this issue, glad to come across the root of the problem

jest-haste-map: @providesModule naming collision:
  Duplicate module name: react-native
  Paths: /Users/${username}/Desktop/${appName}/node_modules/react-native-router-flux/node_modules/react-native/package.json collides with /Users/${username}/Desktop/${appName}/node_modules/react-native/package.json

This warning is caused by a @providesModule declaration with the same name across two different files.
Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: react-native-vector-icons
  Paths: /Users/${username}/Desktop/${appName}/node_modules/react-native/local-cli/core/__fixtures__/files/package.json collides with /Users/${username}/Desktop/${appName}/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/${username}/Desktop/${appName}/node_modules/react-native/local-cli/core/__fixtures__/files/package.json collides with /Users/${username}/Desktop/${appName}/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/${username}/Desktop/${appName}/node_modules/react-native/packager/src/node-haste/DependencyGraph/HasteMap.js:158:13)
    at p.getName.then.name (/Users/${username}/Desktop/${appName}/node_modules/react-native/packager/src/node-haste/DependencyGraph/HasteMap.js:133:31)

Removing react-native-router-flux from my package.json and reinstalling node_modules causes no errors so it’s definitely react-native-router-flux.

Came here to post the same issue, looks like it was accidentally added to the dependencies in this commit: https://github.com/aksonov/react-native-router-flux/commit/34e2d7ac7eb09489c2fd7f19844bd38e27e969fc

I believe It should be listed as a peerDependency instead

yeah this has been destroying my day as well. as a quick work around, you can just go delete the dupe of react-native out of the node_modules folder within react-native-router-flux. Ugly, but will at least get you up and running for the time being

Same issue

Posting the above for convenience copy & paste 😄

watchman watch-del-all && rm -rf node_modules && npm install && npm uninstall react-native-router-flux && npm install --save react-native-router-flux@3.38.0 && rm -fr $TMPDIR/react-* && npm cache clean && npm start -- --reset-cache 

yep, either rollback or remove the folder manually, thanks for the workarounds

Same here, please update the package

same issue, please help to fix

Waiting for the fix I rollback to react-native-router-flux@3.30.1

It’s not related to yarn I believe. Because even if I install it with npm I get the same issue. I deleted my node_modules folder and cleared the npm cache, but the issue was persistent. Currently, I went ahead with a workaround which I read on a GitHub issue where I have to delete the node_modules/react-native-router-flux/node_modules/react-native package. I hope they fix this issue soon.

@abdurrahmanekr @asokol Can we publish this into npm its still showing 3.39.1 as the latest https://www.npmjs.com/package/react-native-router-flux

What worked for me was this sequence:

watchman watch-del-all rm -rf node_modules && npm install npm uninstall react-native-router-flux npm install --save react-native-router-flux@3.38.0 rm -fr $TMPDIR/react-* npm cache clean npm install --save react@16.0.0-alpha.6 npm start – --reset-cache

Rolling back to v0.38.0 or just deleting the react-native folder inside react-native-router-flux/node_modules/ and also delete symlink to react-native inside react-native-router-flux/node_modules/.bin/ will work for now.

Same by me, had to remove the react-native directory inside react-native-router-flux manually to make things work.