Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native packager fails on node 6.5

Tags:

react-native

This was working previously. But since I upgraded from node 4.6 to 6.5, When I do an npm start, I end up with below error

Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: String.prototype.es6
  Paths: ...../node_modules/react-native/packager/react-packager/src/Resolver/polyfills/String.prototype.es6.js collides with ...../app/MallJell/nd/react-native/packager/react-packager/src/Resolver/polyfills/String.prototype.es6.js

This error is caused by a @providesModule declaration with the same name across two different files.
Error: @providesModule naming collision:
  Duplicate module name: String.prototype.es6
  Paths: ....../react-native/packager/react-packager/src/Resolver/polyfills/String.prototype.es6.js collides with ..../react-packager/src/Resolver/polyfills/String.prototype.es6.js

This error is caused by a @providesModule declaration with the same name across two different files.
    at HasteMap._updateHasteMap (..../node_modules/react-native/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js:155:13)
    at module.getName.then.name (.....node_modules/react-native/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js:115:31)
like image 525
Sathyakumar Seshachalam Avatar asked Sep 01 '16 23:09

Sathyakumar Seshachalam


1 Answers

I'm just putting the answer that worked for you here so others can see it.

Remove the node_modules folder

rm -rf node_modules/

Then clean the npm cache and install the modules back

npm cache clean && npm install

Then run the packager again

npm start
like image 108
G. Hamaide Avatar answered Oct 19 '22 00:10

G. Hamaide