Issues with Expo-CLI

Hello everyone,

hope you all are doing well.

I am having issues with expo-cli. I am using VSCode and in the built-in Terminal when I run the command: expo-cli --version it prints 3.0.10.

When I try to run npm start or yarn start it displays a message in a green box saying:

There is a new version of expo-cli available (4.5.2).
You are currently using expo-cli 3.0.10
Run npm install -g expo-cli to get the latest version

Fair enough. I tried several times to run the npm install -g expo-cli and when I check to see if the version has changed, it still says 3.0.10…

I’m really at a loss here…

Anyone else got stuck with this weird issue?

oh and in the MacOS terminal app, if I check the version it says 4.5.2, what is going on here?

Thanks in advance

Try running the command

which expo-cli

from the VSCode terminal and from the MacOS terminal. This will show you the location of the expo-cli being used by each. It sounds like your MacOS terminal is using the version that you installed globally, but your VSCode terminal might be using a local version. You can use

echo $PATH

to see the order in which your shell searches for executables like expo-cli. It’s possible that the VSCode terminal is finding the older version based on the search order.

Thank you so much for the reply, really appreciated

So, in VsCode, it prints: /usr/local/bin/expo-cli
And in the Mac Terminal, it prints: /Users/username/.nvm/versions/node/v12.13.0/bin/expo-cli

So you were right about VsCode not finding the correct one.

I just have to figure out how to change it so it targets the proper one. It’s really not my forte…

If you can spare some more expert advice i’ll take em haha
I’ll do some research in the meantime.

oh! I think I fixed it! After a few hours of scavenging online, here’s what I found and did. I added these lines to my VSCode user > settings.json:

"terminal.integrated.defaultProfile.osx": "zsh",
"terminal.integrated.profiles.osx": {
  "zsh": {
    "path": "/bin/zsh",
    "args": [
       "-l"
    ]
  }
},
"terminal.integrated.env.osx": {
  "PATH": ""
}

So, if anyone has the same issue, you’ll know what to try.