Description
In my project I am using "react-native": "0.36.0"
and among the dependencies:
"lodash": "^4.15.0"
"yeoman-generator": "^0.24.1"
When using versions higher than "^3.10.1"
for "lodash"
and "0.21.2"
for "yeoman-generator"
I get naming collisions on "lodash"
, "inquirer"
and "cli-width"
when running packager.
Reproduction
Have the dependencies described above and run: react-native start --reset-cache
Result:
jest-haste-map: @providesModule naming collision:
Duplicate module name: inquirer
Paths: /CoolProject/node_modules/react-native/node_modules/yeoman-generator/node_modules/inquirer/package.json collides with /CoolProject/node_modules/react-native/node_modules/inquirer/package.json
This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
Duplicate module name: lodash
Paths: /CoolProject/node_modules/react-native/node_modules/lodash/package.json collides with /CoolProject/node_modules/react-native/node_modules/inquirer/node_modules/lodash/package.json
This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
Duplicate module name: cli-width
Paths: /CoolProject/node_modules/react-native/node_modules/yeoman-generator/node_modules/cli-width/package.json collides with /CoolProject/node_modules/react-native/node_modules/cli-width/package.json
This warning is caused by a @providesModule declaration with the same name across two different files.
Solution
Using the same versions for "lodash"
and "yeoman-generator"
as the ones used in react-native@0.36.0
(i.e. "^3.10.1"
for "lodash"
and "0.21.2"
for "yeoman-generator"
) fixes the issue, but changing them is really not an option for me at the moment, especially because "yeoman-generator"
is the dependency of another dependency.
Is there any other possible fix?
Thanks!
Update
More details about this issue can be found in the react-native
Gihub issue I posted: https://github.com/facebook/react-native/issues/11200
Update 2
Upgrading react-native
to 0.39 solves the problem. The actual fix seems to be the removal of the apparently unused (and maybe outdated) yeoman-generator
dependency: https://github.com/facebook/react-native/commit/1fd7a574ba538d05da4be841c84a70766464ec13