Why isn't the latest version of expo installed when trying to install it?

Viewed 2772

I wanted to do the run:android command but found out that the expo-cli version I have is NOT compatible to install the expo SDK version that's required to run the run:android command; the SDK version required is 41 and above.

The expo-cli needed to have the SDKs of 41 and above is 4.4.1, which I've been trying to install but it didn't work well. After typing the command, the install process begins and everything seems to be installed as usual as in other packages. But when checking the version of the cli, it gives the same version as it was beforehand.

Why does this happen?

The last attempt was to uninstall and install it back again. Here are the commands and their results:

$ npm -g uninstall expo-cli

$ npm install -g --force expo-cli
npm WARN using --force I sure hope you know what you are doing.
npm WARN deprecated graphql-tools@3.0.0: This package has been deprecated and now it only exports makeExecutableSchema.\nAnd it will no longer receive updates.\nWe recommend you to migrate to scoped packages such as @graphql-tools/schema, @graphql-tools/utils and etc.\nCheck out https://www.graphql-tools.com to learn what package you should use instead
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated querystring@0.2.0: The
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.        
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated uuid@3.0.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
C:\Users\User\AppData\Roaming\npm\expo -> C:\Users\User\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js
C:\Users\User\AppData\Roaming\npm\expo-cli -> C:\Users\User\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js
+ expo-cli@4.12.0
added 1646 packages from 751 contributors and updated 3 packages in 243.278s

P.S1: "run:android" command gives this:

$ expo run:androd
"run:androd" is not an expo command -- did you mean build:android?
 See "expo --help" for the full list of commands.

1 Answers

Understanding the problem

If I understand correctly; you upgraded Expo-CLI to latest version using: npm install -g expo-cli. This worked fine but you project still breaks with the wrong SDK error mentioned above?

Solution

It seems like you upgraded the Expo-CLI, not the Expo SDK version used for your specific project.

To upgrade your project to use the latest Expo SDK, use the command: expo upgrade.

To upgrade you project to a specific Expo SDK, use the command:

expo upgrade @{required sdk version}

For example: expo upgrade @41.0.0

Upgrading Expo SDK
If you are behind a couple of versions, upgrading your project's Expo SDK version can be difficult because of the number of breaking changes and deprecations in each upgrade. Don't worry. This document links to all the breaking changes in each SDK version upgrade. We strongly recommend upgrading SDK versions incrementally if possible. Doing so will help you pinpoint breakages and issues that arise during the upgrade process. Expo maintains ~6 months of backward compatibility. Once an SDK version has been deprecated, you will no longer be able to use the Expo Go app for development or build new binaries via expo build. However, you will still be able to publish updates via eas update, and build using eas build. Deprecations will not affect standalone apps you have in production.

Related