expo: "expo upgrade is not supported in the local CLI" is confusing

Summary

Currently, npx expo upgrade gives the following message.

$ expo upgrade is not supported in the local CLI, please use expo-cli upgrade instead

But then the global expo-cli says its deprecated, and to use npx expo instead.

This cost me some time and confusion. The error message would benefit from clarification.

  • is expo upgrade deprecated in general, and we should just use npm i expo@latest instead?
  • or is the old global CLI deprecated mostly, but still the recommended way to do expo version upgrade?

What platform(s) does this occur on?

No response

SDK Version

No response

Environment

  expo-env-info 1.0.5 environment info:
    System:
      OS: macOS 13.3.1
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 20.0.0 - ~/.nvm/versions/node/v20.0.0/bin/node
      Yarn: 1.22.19 - ~/.yarn/bin/yarn
      npm: 9.6.4 - ~/.nvm/versions/node/v20.0.0/bin/npm
    Managers:
      CocoaPods: 1.11.3 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
    IDEs:
      Android Studio: 2021.3 AI-213.7172.25.2113.9123335
      Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
    npmPackages:
      expo: ~48.0.15 => 48.0.19 
      react: 18.2.0 => 18.2.0 
      react-native: 0.71.8 => 0.71.8 
    npmGlobalPackages:
      eas-cli: 3.13.2
    Expo Workflow: managed

Minimal reproducible example

npx expo upgrade

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 17
  • Comments: 17 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Running npx expo upgrade should give the correct instructions instead of instructing users to install the deprecated global cli.

This works for me npx expo-cli upgrade

In what way does it work / what do you see when you run that command? I see the following:

$ npx expo-cli upgrade

  $ expo upgrade is not supported in the local CLI, please use expo-cli upgrade instead

The error message from the cli is a time waster.

The linked PR for this discussion looks to suggest that npm install expo@latest && npx expo install --fix would fix this.

(I have not tried it myself though)

Even more confusing… It appears to work, then says it’s not supported

npx expo-cli@latest upgrade
Need to install the following packages:
expo-cli@6.3.10
Ok to proceed? (y) Y
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm WARN deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm WARN deprecated @babel/plugin-proposal-optional-catch-binding@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-catch-binding instead.
npm WARN deprecated @babel/plugin-proposal-async-generator-functions@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
npm WARN deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm WARN deprecated @babel/plugin-proposal-object-rest-spread@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread 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 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 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 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 expo-cli@6.3.10: The global Expo CLI has been superseded by 'npx expo' and eas-cli –– Learn more: https://blog.expo.dev/the-new-expo-cli-f4250d8e3421

  $ expo upgrade is not supported in the local CLI, please use expo-cli upgrade instead

In what way does it work / what do you see when you run that command? I see the following:

$ npx expo-cli upgrade

  $ expo upgrade is not supported in the local CLI, please use expo-cli upgrade instead

in my case when I tried to upgrade expo SDK from 48 to 49 it worked

image

In what way does it work / what do you see when you run that command? I see the following:

$ npx expo-cli upgrade

  $ expo upgrade is not supported in the local CLI, please use expo-cli upgrade instead

in my case when I tried to upgrade expo SDK from 48 to 49 it worked

The steps for upgrading have changed and are detailed here