Duplicate module name: react-native-vector-icons
Asked Answered
H

4

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)
Hibbert answered 21/4, 2017 at 10:51 Comment(1)
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 :)Inimitable
P
6

Solution was posted here

yarn add [email protected]

Preussen answered 21/4, 2017 at 21:8 Comment(0)
I
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.

Inimitable answered 21/4, 2017 at 17:51 Comment(1)
Tried these instructions 3 times with a fresh codebase. Also tried clearing everything out and using yarn. Same errors occurPreussen
H
0

If you work with yarn, please run this command. yarn add [email protected]

And if you work with npm, please run this command. npm install [email protected] --save

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

Then, it will work.

Hobble answered 26/4, 2017 at 20:17 Comment(0)
M
0

NativeBase 2.1.4 solves this issue

Mimosaceous answered 26/5, 2017 at 4:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.