LoginSignup
0
1

More than 1 year has passed since last update.

【メモ】react-native-mapsインストール時にERESOLVE unable to resolve dependency tree

Last updated at Posted at 2021-10-29

環境

  • macOS 11.6
  • Node: 12.13.0
  • npm: 8.1.1
  • react: 17.0.1
  • react-native: 0.64.2
  • react-native-web: 0.17.1

経緯

React-Native + Expoを使用してiPhone, AndroidにGoogle Mapsを表示したく、
ライブラリのreact-native-mapsをインストールした時に発生しました。

npmでreact-native-mapsをインストール

npm install react-native-maps

下記のエラーが発生

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react-native-web@0.17.1
npm ERR! node_modules/react-native-web
npm ERR!   react-native-web@"0.17.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-web@"^0.13" from react-native-maps@0.29.3
npm ERR! node_modules/react-native-maps
npm ERR!   react-native-maps@"^0.29.3" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution

内容は、react-native-webのバージョンが0.17.1でmapsの最新である0.29.3は使用できないから、依存関係が解決できないと言う内容でした。

0.13まで下げる必要があるのか、疑問に思いmapsのIsuueを覗くと同じ現象に陥っている人がいました。

react-native-web@^0.13.0 peer dependency breaks npm install for Expo 43

Isuueを上げた人は元々mapsをインストール済みでExpoのバージョンアップを行おうとしてエラーになったみたいで、今回はそもそもmapsがインストールできないと言う状況。

結論

とりあえずインストールして試してみたかったので、
以下の記事を参考にして
npm v7でERESOLVE unable to resolve dependency tree Could not resolve dependency

npm install --save --legacy-peer-deps react-native-maps

でとりあえずは強制インストールしました。

結局は何も解決していない気もしますが、Isuueを確認しつつ現状でいきたいと思います。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1