'Why do i get 'command not found' even after installing Expo completes successfully?

I have installed Expo-CLI and have the metro bundler running in localhost correctly. I also have an existing Expo account. However when I navigate into the expo project i created and type in any expo related command, it responds like Expo is totally foreign:

enter image description here

Can someone help me figure out what's missing here and how to resolve it please?



Solution 1:[1]

Add the path for the expo-cli to your system.

If you're using Windows then just follow these steps.

  1. Press Windows Key and search for Edit the system environment variables

  2. Go to Environment Variables

  3. Go to User Variable for

  4. Go to Path

  5. Press New

  6. Add %USERPROFILE%\AppData\Roaming\npm to the path

  7. Restart your cmd/powershell

  8. Try writing expo --version to see the version and voila it's working!

Solution 2:[2]

I got the same issue couple of days before, the solution that I found out is to keep "C:\Users\USERNAME\AppData\Roaming\npm" as the only path for npm global installation to check the global path for npm, you can use npm config get prefix, to set the global path for npm ,you can use npm config set prefix %PATH%

after that run npm install and everything will be working !

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Vikingslord
Solution 2 peiting sun