chidimo
chidimo

Reputation: 2948

How do I properly install expo-cli with yarn?

I'm trying to install expo-cli.

When I use npm install -g expo-cli, it installs with the below output.

Output of npm install -g expo-cli

When I try to run the expo command I get an error that the system cannot find the path specified. I then uninstalled with npm uninstall -g expo-cli

I uninstalled node and npm and cleaned up my system, then I tried installing expo-cli with yarn global add expo-cli. It installed with the following output.

Output of yarn global add expo-cli

After this, expo init command worked. But when I run expo start in a project folder I get the below output.

Output of expo-start

I don't know what else to do. I'm on Windows 10.

Upvotes: 8

Views: 39327

Answers (5)

totallytotallyamazing
totallytotallyamazing

Reputation: 2923

I needed to upgrade my Expo SKD from 46 to 47. Since version 46 expo-cli was incorporated into expo and it's also no longer recommended to be installed globally but locally, I used yarn to upgrade expo.

From my local project terminal, (MacOS Monterey, using VS Code) I ran this:

yarn add expo@^47.0.6

-- Be sure to only upgrade Expo SKD Client versions one at a time, (DO NOT Skip versions, e.g. go from say 46 to 48).

Sourced: Upgrade Expo SDK

Upvotes: 0

haas
haas

Reputation: 1

  1. npm cache clean -f
  2. npm install -g n
  3. sudo n stable

Upvotes: -1

Ketan Ramteke
Ketan Ramteke

Reputation: 10645

For Yarn:

If you want to save expo-cli package globally then try

yarn global add expo-cli

and if you want expo-cli to be available in the folder in which you are currently working then use

yarn add expo-cli

For npm:

npm install expo-cli --global

or

npm install expo-cli

Upvotes: 32

bel7aG
bel7aG

Reputation: 9

You want to save expo-cli package globally then try

yarn add global expo-cli

Upvotes: -4

Romario Raffington
Romario Raffington

Reputation: 156

There's a similar issue reported here. You can try adding expo to your local project to see if that helps.

Try:

yarn add expo

Upvotes: 4

Related Questions