-1

When I run

expo-cli doctor

I get

WARNING: The legacy expo-cli does not support Node +17. Migrate to the versioned Expo CLI (npx expo).

But when I run

yarn expo doctor

I get

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

This seems circular, or at least fishy. I have the latest expo and expo-cli installed, but I'm still being told to install something else (more recent).

How do I fix this so I'm not being told to install something that (I think) I already have installed.


Anywhere:

$ npm list --location=global --depth=0
/opt/homebrew/lib
├── @aws-amplify/cli@10.7.3
├── corepack@0.16.0
├── create-expo-app@1.3.2
├── eas-cli@3.6.0
├── expo-cli@6.3.1
├── firebase-tools@11.23.1
├── ios-sim@9.0.0
├── npm-check-updates@16.7.5
├── npm@9.5.0
└── react-devtools@4.27.2
$ which -a eas
/opt/homebrew/bin/eas
$ eas --version
eas-cli/3.6.0 darwin-arm64 node-v18.14.1
$ expo --version
WARNING: The legacy expo-cli does not support Node +17. Migrate to the versioned Expo CLI (npx expo).
6.3.1

In my project directory:

$ yarn list
...
├── expo-dev-client@2.0.1
├── expo-file-system@15.1.1
├── expo-sharing@11.0.1
├── expo-splash-screen@0.17.5
├── expo-status-bar@1.4.4
├── expo-updates@0.15.6
├── expo@47.0.13
$ which -a expo
/private/var/folders/90/46v8ldy13r13wf1hr7w9xzfw0000gn/T/xfs-08dd5804/expo
/opt/homebrew/bin/expo
$ /private/var/folders/90/46v8ldy13r13wf1hr7w9xzfw0000gn/T/xfs-08dd5804/expo
-bash: /private/var/folders/90/46v8ldy13r13wf1hr7w9xzfw0000gn/T/xfs-08dd5804/expo: No such file or directory
...

At ~:

$ npm list
/Users/Rax
└── (empty)
$ yarn list
yarn list v1.22.19
Done in 0.01s.
$ which -a expo
/opt/homebrew/bin/expo
orome
  • 45,163
  • 57
  • 202
  • 418

1 Answers1

-1

You need to do exactly what error message states. Instead of running expo-cli you need to use npx expo, it will use locally installed(in your project) version of the expo cli that is tied to the version of expo package in your project.

Note that expo doctor is not implemented in local cli, so that command is always using global one.

Wojciech Kozyra
  • 500
  • 3
  • 3
  • That's not the case. I have the correct versions installed. It's just a [bad error message](https://forums.expo.dev/t/why-am-i-told-to-install-versioned-expo-cli-when-its-already-installed/69654/2?u=orome) (about the node version I'm using). – orome Feb 19 '23 at 16:26
  • No, message is correct, but it might be misleading. Global expo-cli does not support node 17+ and because doctor is not implemented in local cli, so it's using implementation from the global one. Based on what you provided above, you are using node 18 which is not compatible with the old global cli, so you don't have "correct" version installed. – Wojciech Kozyra Feb 19 '23 at 19:06
  • It's both, but more incorrect than misleading since the instructions on how to remedy are wrong. (Also Node 18 should be supported if the documentation is the be believed, since it's LTS.) – orome Feb 19 '23 at 19:12