2

I'm encountering an issue while trying to create a React Native Expo project. When running the command npx create-expo-app my-app, I receive warnings that include the following message: WARNING: The legacy expo-cli does not support Node +17. Migrate to the versioned Expo CLI (npx expo).

The problem arises because I have NodeJS 18 installed on my system, and I prefer not to downgrade to NodeJS 16, which is suggested as a solution in various sources. I believe using NodeJS 18 should be compatible with creating the Expo project. Is there a way to resolve this issue without downgrading NodeJS?

I have also attached an image for reference:

enter image description here

Any insights or suggestions would be greatly appreciated. Thank you!"

2 Answers2

3

I don't think expo-cli has support for node version higher than node 16. As you mentioned you don't want to downgrade your node version, any specific reason for that? Moreover, you can use nvm to have multiple node versions installed on your system and you can specify the version of node you want to use for a project.

Installing NVM and using it:

  1. You can get the latest nvm depending on your system from here.
  1. Once you have successfully installed NVM, install the node version you want: nvm install vX.Y.Z -> Specify the version you want to install in place of X.Y.Z

  2. Now, to use the installed version use- nvm use vA.B.C.

Adii_Mathur
  • 307
  • 2
  • 7
1

you do not need to use the global expo-cli package at all anymore, it is deprecated. use npx expo within the project to invoke the cli from the local expo package within the project. eg: npx expo start. not all commands live on this new local cli package, for example you can use npx expo-doctor to use the npm package expo-doctor instead of expo doctor. see this blog post for more information: https://blog.expo.dev/the-new-expo-cli-f4250d8e3421

brentvatne
  • 7,603
  • 4
  • 38
  • 55
  • I'm using `npx` when creating a project, but still it warns me about nodejs version – Faseeh Hyder Feb 25 '23 at 07:07
  • in your screenshot you are running `expo doctor`. run `npx expo-doctor` for the equivalent that does not use the deprecated "global" expo-cli package – brentvatne Feb 25 '23 at 07:08
  • now after using `npx expo-doctor` it tells me that `'sh' is not recognized as an internal or external command, operable program or batch file.` am using terminal for executing commands on windows – Faseeh Hyder Feb 25 '23 at 07:22