For mac users (linux should be very similar):
Find your expo-cli version:
which expo-cli
For me it yielded:
/Users/username/.config/yarn/global/node_modules/.bin/expo-cli
Remove this outdated version:
rm -rf /Users/username/.config/yarn/global/node_modules/.bin/expo-cli
Check that you are using the latest version:
expo-cli --version
Answer from laurent lahmy on Stack OverflowFor mac users (linux should be very similar):
Find your expo-cli version:
which expo-cli
For me it yielded:
/Users/username/.config/yarn/global/node_modules/.bin/expo-cli
Remove this outdated version:
rm -rf /Users/username/.config/yarn/global/node_modules/.bin/expo-cli
Check that you are using the latest version:
expo-cli --version
Updating expo-cli globally can be a right pain. To those experiencing this frustration, use yarn
yarn global add expo-cli
it will give you far fewer headaches
Videos
I'm having trouble running a dev build with expo-notifications. Whenever I use it I get the following error: Cannot read property __expo_module_name__ of undefined.
So digging around on google I found some posts that suggest some library or version incompatibility which is why I was checking my expo version. expo --versionreturns WARNING: The legacy expo-cli does not support Node +17. Migrate to the versioned Expo CLI (npx expo). 6.3.2
Could this be the cause for the error? How can I upgrade to the version Expo CLI?
As I'm a beginner I appreciate all the help I can get, thank you!
edit. updated my understanding a little, please correct me if I'm wrong. So if I run npx expoand then the command it should always take the latest version of expo anyway, right?
» npm install expo-cli