1--- 2title: Install Expo modules 3description: Learn how to prepare your existing React Native project to install and use any Expo module. 4--- 5 6import InstallSection from '~/components/plugins/InstallSection'; 7import { DiffBlock } from '~/ui/components/Snippet'; 8import { YesIcon, NoIcon } from '~/ui/components/DocIcons'; 9 10To use Expo modules in your app, you will need to install and configure the `expo` package. 11 12The `expo` package has a small footprint; it includes only a minimal set of packages that are needed in nearly every app and the module and autolinking infrastructure that other Expo SDK packages are built with. Once the `expo` package is installed and configured in your project, you can use `npx expo install` to add any other Expo module from the SDK. 13 14Depending on how you [initialized the project](/bare/overview/), there are two ways you can install the Expo modules: [automatic](#automatic-installation) or [manual](#manual-installation). 15 16## Automatic installation 17 18To install and use Expo modules, the easiest way to get up and running is with the `install-expo-modules` command. 19 20<InstallSection 21 packageName="expo" 22 cmd={[ 23 '# Install and configure the expo package automatically', 24 '$ npx install-expo-modules@latest', 25 ]} 26 hideBareInstructions 27/> 28 29- <YesIcon small /> **When the command succeeds**, you will be able to add any Expo module in your app! 30 Proceed to [Usage](#usage) for more information. 31 32- <NoIcon small /> **If the command fails**, please follow the manual installation instructions. Updating 33 code programmatically can be tricky, and if your project deviates significantly from a default React 34 Native project, then you need to perform manual installation and adapt the instructions here to your 35 codebase. 36 37## Manual installation 38 39The following instructions apply to installing the latest version of Expo modules in React Native 0.71. 40 41<InstallSection packageName="expo" cmd={['npm install expo']} hideBareInstructions /> 42 43Once installation is complete, apply the changes from the following diffs to configure Expo modules in your project. This is expected to take about five minutes, and you may need to adapt it slightly depending on how customized your project is. 44 45### Configuration for Android 46 47<DiffBlock source="/static/diffs/expo-android.diff" /> 48 49### Configuration for iOS 50 51<DiffBlock source="/static/diffs/expo-ios.diff" /> 52 53Optionally, you can also add additional delegate methods to your **AppDelegate.mm**. Some libraries may require them, so unless you have a good reason to leave them out, it is recommended to add them. [See delegate methods in AppDelegate.mm](https://github.com/expo/expo/blob/b7c0356c697ef2cf46388e5742d67b7b48adc97f/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm#L75-L102). 54 55Save all of your changes. In Xcode, update the iOS Deployment Target under `Target → Build Settings → Deployment` to `iOS 13.0`. The last step is to install the project's CocoaPods again to pull in Expo modules that are detected by `use_expo_modules!` directive that we added to the `Podfile`: 56 57<InstallSection 58 packageName="expo" 59 cmd={[ 60 '# Install pods', 61 '$ npx pod-install', 62 '', 63 '# Alternatively, the run command will install them for you', 64 '$ npx expo run:ios', 65 ]} 66 hideBareInstructions 67/> 68 69## Usage 70 71### Verifying installation 72 73You can verify that the installation was successful by logging a value from [`expo-constants`](/versions/latest/sdk/constants). 74 75- Run `npx expo install expo-constants` 76- Then, run `npx expo run:[android|ios]` and modify your app JavaScript code to add the following: 77 78```js 79import Constants from 'expo-constants'; 80console.log(Constants.systemFonts); 81``` 82 83### Using Expo SDK packages 84 85Once the `expo` package is installed and configured in your project, you can use `npx expo install` to add any other Expo module from the SDK. See [Using Libraries](/workflow/using-libraries) for more information. 86 87### Expo modules included in the `expo` package 88 89The following Expo modules are brought in as dependencies of the `expo` package: 90 91- [`expo-application`](/versions/latest/sdk/application) - Generates the installation id in remote logging in development. This module is optional and can be safely removed if you do not use `expo-dev-client`. 92- [`expo-asset`](/versions/latest/sdk/asset) - A JavaScript-only package that builds around `expo-file-system` and provides a common foundation for assets across all Expo modules. 93- [`expo-constants`](/versions/latest/sdk/constants) - Provides access to the manifest. 94- [`expo-file-system`](/versions/latest/sdk/filesystem) - Interact with the device file system. Used by `expo-asset` and many other Expo modules. Commonly used directly by developers in application code. 95- [`expo-font`](/versions/latest/sdk/font) - Load fonts at runtime. This module is optional and can be safely removed, however; it is recommended if you use `expo-dev-client` for development and it is required by `@expo/vector-icons`. 96- [`expo-keep-awake`](/versions/latest/sdk/keep-awake) - Prevents your device from going to sleep while developing your app. This module is optional and can be safely removed. 97 98To exclude any of these modules, refer to the following guide on [excluding modules from autolinking](#excluding-specific-modules-from-autolinking). 99 100### Excluding specific modules from autolinking 101 102If you need to exclude Expo modules that you are not using but they got installed by other dependencies, you can use the `expo.autolinking` field in **package.json**: 103 104```json package.json 105{ 106 "name": "...", 107 "dependencies": {}, 108 "expo": { 109 "autolinking": { 110 "exclude": ["expo-keep-awake"] 111 } 112 } 113} 114``` 115 116You can also exclude a specific platform by using `exclude` under the platform key: 117 118```json package.json 119{ 120 "name": "...", 121 "dependencies": {}, 122 "expo": { 123 "autolinking": { 124 "exclude": ["expo-font"], 125 "ios": { 126 "exclude": ["expo-keep-awake"] 127 } 128 } 129 } 130} 131``` 132