Upgrading expo SDK incrementally from expo 35 and I'm stuck in an an " upgrade' is not an expo command" loop

Hi there,

I just took a project off the shelf after…a long time…and tried to run it using expo on my mobile device. Not surprisingly, after nothing loads, I see a notice “SDK: 35 Not Supported” and elsewhere when I tap the project under “Published Projects” from within the expo app on mobile I see “This project uses SDK v35.0.0. Your client supports SDK’s: 37,38,39,40. If you want to open this project, the author will need to update the project’s SDK version.”

Next step: update expo SDK from v 35 to (at least) 37 incrementally. Following steps to upgrade on expo blog for SDK 36 I go into my project’s directory and run expo upgrade. Terminal output: “upgrade” is not an expo command. See “expo --help” for the full list of commands.’

According to same post, running that command "requires the latest version of expo-cli. Ok, so I need the new version of expo-cli.

Next step: (Still in the project directory) I run npm i -g expo-cli. Terminal output:

npm WARN deprecated @hapi/joi@17.1.1: Switch to 'npm install joi'
npm WARN deprecated @hapi/address@4.1.0: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/formula@2.0.0: Moved to 'npm install @sideway/formula'
npm WARN deprecated @hapi/pinpoint@2.0.0: Moved to 'npm install @sideway/pinpoint'
npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
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 fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated joi@11.4.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated topo@2.0.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
/Users/placeholdername/.npm-global/bin/expo -> /Users/placeholdername/.npm-global/lib/node_modules/expo-cli/bin/expo.js
/Users/placeholdername/.npm-global/bin/expo-cli -> /Users/placeholdername/.npm-global/lib/node_modules/expo-cli/bin/expo.js
npm WARN @pmmmwh/react-refresh-webpack-plugin@0.3.3 requires a peer of react-refresh@^0.8.2 but none is installed. You must install peer dependencies yourself.
npm WARN @pmmmwh/react-refresh-webpack-plugin@0.3.3 requires a peer of type-fest@^0.13.1 but none is installed. You must install peer dependencies yourself.
npm WARN @pmmmwh/react-refresh-webpack-plugin@0.3.3 requires a peer of webpack-hot-middleware@2.x but none is installed. You must install peer dependencies yourself.
npm WARN @pmmmwh/react-refresh-webpack-plugin@0.3.3 requires a peer of webpack-plugin-serve@0.x || 1.x but none is installed. You must install peer dependencies yourself.

+ expo-cli@4.3.2
updated 1 package in 44.853s

Seems from terminal output above that expo-cli has been updated. Great.

Next step: (still in project directory) I run expo upgrade. Terminal output: “upgrade” is not an expo command. See “expo --help” for the full list of commands.’

Seems like I’m stuck in a loop :confused:

Many posts on similar subjects include recommendations to run yarn global add expo-cli. When I run that the terminal output is: “-bash: yarn: command not found”.

When //

> yarn@1.22.10 preinstall /Users/placeholdername/.npm-global/lib/node_modules/yarn

> :; (node ./preinstall.js > /dev/null 2>&1 || true)

/Users/placeholdername/.npm-global/bin/yarn -> /Users/placeholdername/.npm-global/lib/node_modules/yarn/bin/yarn.js

/Users/placeholdername/.npm-global/bin/yarnpkg -> /Users/placeholdername/.npm-global/lib/node_modules/yarn/bin/yarn.js

+ yarn@1.22.10

updated 1 package in 1.159s

Here’s my output from expo diagnostics:

There is a new version of expo-cli available (4.3.1).
You are currently using expo-cli 2.1.3
Run `npm install -g expo-cli` to get the latest version
[12:03:51] Generating diagnostics report...
[12:03:51] You can join our slack here: https://slack.expo.io/.

Environment:
  OS: macOS 10.15.4
  Node: 14.16.0
  Yarn: Not Found
  npm: 6.14.11
  Watchman: Not Found
  Xcode: Xcode 10.1 Build version 10B61
  Android Studio: Not Found

Packages: (wanted => installed)
  expo: ^35.0.0 => 35.0.1
  react: 16.8.3 => 16.8.3
  react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8

Diagnostics report:
-[12:03:56] Request failed with status code 500
[12:03:56] Set EXPO_DEBUG=true in your env to view the stack trace.

I’m stuck. What’s the next step to try?

Thanks!

There is a new version of expo-cli available (4.3.1).
You are currently using expo-cli 2.1.3

you have some very old version of expo-cli installed, you should track down where that is and delete it so that you can use the new cli version

Thanks!

Yes, I’ve tried killing that version of expo several times. I seem to be having the same problem as the poster here.

I’m afraid I don’t know much about how to deal with the path so I’ve been hesitant to implement any suggestions related to things I don’t understand…but I followed along with the travails and troubleshooting here and was able to update expo.

what operating system are you using? what is the result of which expo? if you’re in a state where you have stale global binaries taking precedence in your PATH over freshly installed binaries, you may want to try uninstalling and reinstalling node

Operating System: Mac OS Catalina v. 10.15.4

Ryans-Air:~ placeholdername$ which expo
/usr/local/bin/expo

After following @wodin’s instructions here the version shown was (temporarily) updated to the newest! And I was able to increment up to expo 36 using expo upgrade.

Now, however, the next run of expo upgrade comes back with the same "upgrade" is not an expo command. See "expo --help" for the full list of commands that was the outcome of my original problem loop. And expo --version shows that I’m somehow back at 2.1.3 :confused:

rm /usr/local/bin/expo

you’re having the same problem as before, you haven’t fixed the underlying issue, you should fix that or you’re not going to have a good time doing development with node related tools

1 Like

Thanks for your continued help.

I’m definitely trying to address the underlying issue rather than just set timebombs for myself in the future. So I’m here to learn the most efficient route to take while navigating a new area I haven’t deeply explored. Of course it’s more of a challenge when multiple new, interdependent concepts/entities are encountered and I don’t know the fundamentals well enough to know if my “solution” is efficient, or really even a solution.

To clarify - I should run the command rm /usr/local/bin/expo ? By the looks of it, this will remove expo at the deepest level, so that I can start fresh?

i think your best path forward is to do that, uninstall node, and then install node via nvm: GitHub - nvm-sh/nvm: Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions

1 Like

Thanks @notbrent for prompting me to learn the value of the which command - I hadn’t used it before and I’m not very practiced in troubleshooting with the command line.

For the noobs and dabblers who find themselves in my situation - just make sure you know where the old node/expo stuff is and make sure you properly delete it.

Use which to find everything that has to do with expo or node that you have used in the past (some of which you may have forgotten that you used if it has been a while since working on your project)

which expo
which node
which brew
which yarn
which expo-cli

Delete them using rm command as you find them.

Install nvm and install node using nvm install node .

Install expo globally as per docs npm i -g expo-cli.

Issue resolved. Close 'er up!

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.