Projects producing "The Expo SDK requires Expo to run" error

I have just migrated to a new workstation, and I’m having a hard time running my existing Expo projects, as well as creating brand new Expo projects using the expo-cli.

expo diagnostics produces the following output:

$ expo diagnostics
[19:28:50] Generating diagnostics report...
[19:28:50] You can join our slack here: https://slack.expo.io/.

  Expo CLI 2.2.3 environment info:
    System:
      OS: Linux 4.18 Ubuntu 18.10 (Cosmic Cuttlefish)
      Shell: 4.4.19 - /bin/bash
    Binaries:
      Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node
      npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
    npmPackages:
      expo: ^30.0.1 => 30.0.1
      react: 16.3.1 => 16.3.1
      react-native: https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz => 0.55.4
      react-navigation: ^2.16.0 => 2.16.0
    npmGlobalPackages:
      expo-cli: 2.2.3

Trying to init a new Expo project, I run:

$ expo init testproject
...
$ cd testproject/
$ expo start
[18:40:45] Starting project at /mnt/storage/Projects/testproject
[18:40:45] Expo DevTools is running at http://localhost:19002
[18:40:45] Opening DevTools in the browser... (press shift-d to disable)
[18:40:48] Starting Metro Bundler on port 19001.
[18:40:48] Metro Bundler ready.
[18:40:48] Successfully ran `adb reverse`. Localhost URLs should work on the connected Android device.
[18:40:50] Trying to open the project on Android...
[18:40:50] Downloading latest version of Expo
[18:40:50] Installing Expo on device
[18:40:52] Opening on Android device

At this point, in my emulator, I see this screen:

Full stack trace:

The Expo SDK requires Expo to run. It appears the native Expo modules are unavailable and this code is not running on Expo. Visit https://docs.expo.io to learn more about developing an Expo project.
<unknown>
    validate.js:11:8
loadModuleImplementation
    require.js:214:12
guardedLoadModule
    require.js:148:36
_require
    require.js:132:20
<unknown>
    Expo.js:2
loadModuleImplementation
    require.js:214:12
guardedLoadModule
    require.js:148:36
_require
    require.js:132:20
<unknown>
    AppEntry.js:1
loadModuleImplementation
    require.js:214:12
guardedLoadModule
    require.js:141:45
_require
    require.js:132:20
global code

Any ideas what might be wrong, and where to look for potential problems?

1 Like

I got the exact same error this morning, after I updated expo-cli to 2.2.3 . But yesterday, the previous version didn’t give me any error.

So I tried rollbacking “expo-cli” to the previous version, but I continue to get the same error. I can’t explain it. I thought rollbacking would have solved the problem.

So I’m stuck.

I’ve got the same problem unfortunately, on a real device (android).
Cross-posting from https://github.com/expo/expo/issues/2058#issuecomment-433495248

Hi all – apologies for this error. Please upgrade to expo-cli@2.2.4 – this should be fixed now.

1 Like

Thanks, this did the trick :slight_smile:
I was initially struggling to get this right, we have to install globally expo-cli@2.2.4: npm install -g expo-cli I didn’t have to specify the version.

I just ran into this problem even though I didn’t had this before. I’m running expokit@1.7.1, expo-cli@2.2.4 and expo@30.0.0. This is a detached Android build

For now I have to work around to comment out the part:

if (!Constants || !Constants.expoVersion) {
  // throw new Error(
  //   `The Expo SDK requires Expo to run. It appears the native Expo modules are unavailable and this code is not running on Expo. Visit https://docs.expo.io to learn more about developing an Expo project.`
  // );
}

Could anyone help me a hand with this situation?

Hi @bankify_expo_admin - do you know what changed between when it was working and when it stopped working? Did you upgrade a library or your version of expo-cli?

I am having the same problem. No change to my development environment. Thursday it was working. Friday, this error. In between I did do an iOS build.

I have tried deleting and re-installing node_modules, and upgrading expo-cli, without fix.

expo diagnostics

Expo CLI 2.2.5 environment info:
    System:
      OS: macOS 10.14
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.9.0 - /usr/local/bin/node
      Yarn: 1.9.4 - /usr/local/bin/yarn
      npm: 6.2.0 - /usr/local/bin/npm
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 10.0/10A255 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^30.0.1 => 30.0.1
      react: 16.3.1 => 16.3.1
      react-native: https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz => 0.55.4
      react-navigation: ^2.17.0 => 2.17.0
    npmGlobalPackages:
      expo-cli: 2.2.5

Sorry for delayed response, I wasn’t changing any configuration and expo-cli, it was just showing the error out of nowhere, while the day before it didn’t

Strange thing is that when commenting out the error throwing code, the app works just fine and I haven’t found any issues.

I had same error when I updated Expo client in play store. I fixed it by uninstalling Expo client and installing Expo client from the command line with ‘expo install:android’

1 Like

Where is that code to comment out?

This is working again. Emulator downloaded new version of Expo Client on boot up, now working fine.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.