Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Naming collision detected

Tags:

react-native

when I start development server using this command:

react-native start

then I am getting error this:

Error building DepdendencyGraph:

Error: Naming collision detected: /home/awesomepankaj/Work/lifemakerProjects/workingLifemaker/LifeMaker/node_modules/react-native/node_modules/react-tools/src/shared/vendor/core/dom/focusNode.js collides with /home/awesomepankaj/Work/lifemakerProjects/workingLifemaker/LifeMaker/node_modules/react-native-modalbox/node_modules/react-native/node_modules/react-tools/src/shared/vendor/core/dom/focusNode.js

react-native version 0.13

Ubuntu 14.04

like image 846
Pankaj Thakur Avatar asked Oct 22 '15 07:10

Pankaj Thakur


4 Answers

If your are stuck up here.

It is a quick fix for now.

You can delete you react-native folder from node_module/react-native-router/node_module/react-native

Instead, you can use react-native from node_module/react-native.

like image 121
Pankaj Thakur Avatar answered Sep 30 '22 19:09

Pankaj Thakur


It's probably because you have multiple /node_modules folders in one of your subfolders.

like image 23
JWindey Avatar answered Sep 30 '22 18:09

JWindey


If you have the directory path like this:

app/
  ios/
     Pods/
        React/
           node_modules/
  node_modules/
  src/
     index.ios.js
  package.json

Then you can just run

$ ./node_modules/react-native/packager/packager.sh --projectRoots `pwd`/src --projectRoots `pwd`/node_modules

More detail:

https://github.com/facebook/react-native/issues/3440

like image 43
NSKevin Avatar answered Sep 30 '22 18:09

NSKevin


For those who still have this issue or might have it, I suggest you update npm to the latest version, which will flatten all the modules in the node_modules folder, therefore reducing the risks of duplicated packages.

like image 40
Guillaume Avatar answered Sep 30 '22 18:09

Guillaume