Cannot make basic expo work

I’m using the latest expo, React Native SDK 36.0.0, and I always get the following message once I connect from my phone back to the PC:

Error: Unable to resolve module ./node_modules\expo\AppEntry from ``:

I used expo init foo to create the initial app, and have selected various of the options, both ts and js, but have the same issue every time. I tried it with yarn and then uninstalled yarn and tried again, still with the same result.The file pointed to from main in package.js is node_modules/expo/AppEntry.js and it exists. The error message says that none of the list of files are found:

node_modules\expo\AppEntry(.native|.android.expo.ts|.native.expo.ts|.expo.ts|.android.expo.tsx|.native.expo.tsx|.expo.tsx|.android.expo.js|.native.expo.js|.expo.js|.android.expo.jsx|.native.expo.jsx|.expo.jsx|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.wasm|.native.wasm|.wasm)

although .js is in the list (marked in bold).

My expo-cli version is 3.13.1, npm is 6.13.7 and node is 13.9.0.

There are a number of topics similar to this using old SDKs and one that appeared to work referred to using a list of extensions in the packagerOpts object, but that object doesn’t exist and it still fails when I add it. Some older comments claim that it is caused by Metro but I can’t see that, although I don’t know metro.

After almost 3 days of trying all sorts of weird and wonderful workarounds, I’m about to abandon React Native and use Cordova or Ionic instead - not my first choice, but if it doesn’t work for the simple out-of-the-box case, I really don’t have a choice.

Hi

It should definitely work to do:

expo init foo
cd foo
expo start

If that doesn’t work then something weird is going on.

Based on the path separators in your message it looks like you’re on Windows. There have been some weird issues on Windows in the past.

Here are some things that might help:

You could try downgrading to node 12.x or node 10.x.
You could try running from PowerShell or WSL instead of cmd.exe.
If I were using Windows I would use WSL because the environment is closer to macOS, which seems to be more popular with the Expo developers, so I believe is less likely to suffer from regressions or strange issues like the one you’re seeing.

Good luck!

Unfortunately that definitely doesn’t work and something weird is going on. Rather than continue to wrestle with something that is fundamentally broken, I switched to Ubuntu and it’s all running fine now. It’s a pity that the acceptance tests don’t catch this.

1 Like

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