‘expo’ is not recognized as an internal or external command

chayyccee

Eke Chinedu Kenechukwu

Posted on February 26, 2022

‘expo’ is not recognized as an internal or external command

So you just installed expo globally on your windows 10, using

npm install -global expo-cli

After which you tried to be sure expo is installed and you tried
expo --version

but you get this error below
'expo' is not recognized as an internal or external command

Don't panic, to solve this, simply run the command below on cmd (as an administrator)

setx path "%path%;C:\Users\<USERNAME>\AppData\Roaming\npm

Thereafter, You should see the following

WARNING: The data being saved is truncated to 1024 characters.
SUCCESS: Specified value was saved.

that let's you know you were successful.

Now run
expo --version

you should now see the version of expo installed, and that you can now use the expo command.

But if that doesn't work,
That means you will need to manually add the path to your machine's Environment Variables.
At the time of this article,

I'm using

 
npm version 8.5.2

node version 16.14.0

which are the latest versions and have corepack enabled in node, this helps me to easily update yarn. To enable corepack, simply run

corepack enable

Now, after the update to the latest stable/LTS versions of npm and node, 
go to windows search, search for edit the system variables , enter the option
select Environment Variables (located at the bottom of the box)
under system variables
scroll and select Path and click on Edit

NOTE: PLEASE DO NOT CLICK THE "NEW" BUTTON UNLESS YOU KNOW WHAT YOU ARE DOING, BECAUSE ANY CHANGE, WILL WIPE OUT EXISTING PATHS.

after clicking on Edit, select New and then add the npm path to the list.
usually, the npm package is saved in 
C:\Users\<your computer username>\AppData\Roaming\npm

after adding that path,
click "ok" on all boxes, close your terminal, reopen your terminal,
run expo installation again.
npm install -global expo-cli

after that, your can check if it successfully installed using
expo --version
expo-cli --version

At the time of this article, expo and expo-cli is at version 5.2.0

I hope this was helpful. Feel free to reach out if your installation challenge persists.

Happy Hacking…

💖 💪 🙅 🚩
chayyccee
Eke Chinedu Kenechukwu

Posted on February 26, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related