LoginSignup
14
2

More than 3 years have passed since last update.

結論

expo installは、

「使用中のExpo SDKのバージョンと互換性のある依存関係のバージョンをインストールする」

点が異なります。

挙動の違い

npm installもexpo installも実際のインストールはnpmやyarnを呼び出します。

expo installでインストールする場合

expo install expo-secure-store

image.png

yarnを使ってSDK39と互換性のあるネイティブモジュールをインストールと書いてありますね。
以下のようにバージョンをしてくれています。

expo-secure-store@~9.2.0

npm installでインストールする場合

image.png

npm installでも結果的に同じ9.2.0がインストールされました。ただバージョンの指定はされていないですね。

おわりに

expo installを使うとexpoのSDKと互換性のあるバージョンのnpmをインストールしてくれるので、Expoで紹介されている公式コンポーネントは全てexpo installでインストールしましょう。

npm installだとライブラリによっては、バージョンの差異でexpoが動かなくなることがあるので注意してください。

14
2
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
14
2