Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'expo' is not recognized as an internal or external command

After running npm install -g expo-cli and successfully installing the packages globally, expo is still not recognized as an internal or external command. Does anyone know how I might get around this issue using windows 10, or what to do in terms of something like a path variable.

like image 680
jf___ Avatar asked Oct 10 '18 02:10

jf___


People also ask

How do you fix Expo is not recognized as an internal or external command?

To solve the error "'expo' is not recognized as an internal or external command, operable program or batch file", install the expo cli globally by running npm install --global expo-cli and make sure your PATH environment variable is set up correctly.

How do you check if Expo CLI is installed?

If you want to see how your app will run on your device, all you have to do is connect it, run npx expo run:ios —-device , select your connected device. Expo CLI will automatically sign the device for development, install the app, and launch into it.

Does Expo install react native?

Expo Go allows you to run your React Native app on a physical device without installing iOS and Android native SDKs.


2 Answers

Probably the only thing missing is to add the expo executable to your path.

For Windows 10, you can simply add the npm folder to your path environment variable.

  1. Hit Windows key and search for Environment variables.
  2. Inside the Path variable under System variables, add a new entry (entries are separated by semicolons) with this content (without /node_modules ):

%USERPROFILE%\AppData\Roaming\npm

OR if you are using yarn C:\Users\{USER}\AppData\Local\Yarn\bin (as @Qwerty mentioned above)

  1. Open a new command prompt and enter

> expo

You will see something like this: enter image description here

like image 58
Rocío García Luque Avatar answered Oct 11 '22 14:10

Rocío García Luque


I may be too late to answer this, but for people looking for the same error this is what worked for me.

  1. Install yarn if you don't have it. I used the command choco install yarn (you'll have to install Chocolatey). If you have scoop installed, scoop install yarn also works.

  2. Use yarn to install expo with yarn global add expo-cli.

  3. expo start should work now. yarn start and npm start should also work.

Hope that helps!

like image 31
Ruby Avatar answered Oct 11 '22 14:10

Ruby