説明
私のプロジェクト"react-native": "0.36.0"
では、依存関係の中で使用しています:
"lodash": "^4.15.0"
"yeoman-generator": "^0.24.1"
"^3.10.1"
for"lodash"
および"0.21.2"
forよりも新しいバージョンを使用すると、 で"yeoman-generator"
名前の競合が発生し"lodash"
、パッケージャーを実行する"inquirer"
と発生します。"cli-width"
再生
上記の依存関係を用意して実行します。react-native start --reset-cache
結果:
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.
解決
for と forで使用されているもの(つまりforとfor )"lodash"
と同じバージョンを使用すると問題は解決しますが、特に別の依存関係の依存関係があるため、それらを変更することは現時点では実際にはオプションではありません。他に可能な修正はありますか?"yeoman-generator"
react-native@0.36.0
"^3.10.1"
"lodash"
"0.21.2"
"yeoman-generator"
"yeoman-generator"
ありがとう!
アップデート
この問題の詳細については、react-native
私が投稿した Gihub の問題を参照してください: https://github.com/facebook/react-native/issues/11200
更新 2
0.39 にアップグレードreact-native
すると、問題が解決します。実際の修正は、明らかに使用されていない (そしておそらく古い)yeoman-generator
依存関係の削除のようです: https://github.com/facebook/react-native/commit/1fd7a574ba538d05da4be841c84a70766464ec13