Justin Park
Justin Park

Reputation: 21

The term 'expo' is not recognized as the name of a cmdlet

i am attempting to create a react native (expo) project and followed the installation guide on their doc site but am running across an error.
I am running on windows 10. i ran these steps in the powershell.
npm install --global expo-cli
as well as npm install expo
then, when i try to create a new project by running expo init my-project
i get the error below.

expo : The term 'expo' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

I've tried adding %USERPROFILE%\AppData\Roaming\npm into the path variable but it doesnt affect anything.
please help
error output

Upvotes: 1

Views: 4475

Answers (2)

I happened to resolve mine by looking out for the directory in which the expo-cli was installed. I happened to find mine in a path that has this format C:\Users\USERNAME\.npm

Once you get to the directory, you will notice you have your expo and expo-cli files and scripts in there. Then follow the steps below

  1. Click on the windows button and search for "Environmental Variables"
  2. On the System variables section, double click on the "Path"
  3. Click on new and paste the directory path of which you find the expo and expo-cli files and scripts. eg C:\Users\USERNAME\.npm
  4. Click on "Ok", close the terminal and re-open it again, then run the command
    I hope it works for you

Upvotes: 0

Justin Park
Justin Park

Reputation: 21

I found the issue. I had to bring the path priority upwards.
enter image description here

Upvotes: 1

Related Questions