Expo CLI looks installed but 'expo: command not found'


#1

Having trouble getting through the ‘getting started guide’, and would any help debugging the issue!

I’ve installed node.js and ran ‘npm install -g expo-cli’ which threw some warnings but no errors, but running any expo command is throwing a ‘-bash: expo: command not found’ response (screenshot attached)

Some more context that could be helpful:

  • I ended up installing node.js through npm and moving its location on computer. I did this because I got a permissions error trying to install expo after downloading node.js through the link in the expo guide (https://nodejs.org/en/) and found a suggestion to move its location after digging around a bit. I may have messed that part up somehow though.
  • I can see an ‘expo-cli’ file in /users/me/.npm-global/bin/expo

Specific questions:

  • Is there a command similar to ‘node -v’ that can verify whether expo is installed?
  • I’ve probably installed multiple versions now of both node.js and expo, but couldn’t find a clearly safe way to fully remove all versions of both from my computer and try to start over. Is this a recommended path?

Any other insight would be helpful. Thank you in advance!


Command Not Found (previously was)
#2

Sounds like an environment issue. Your computer needs to know where to look for programmes when you run them. If you moved things around during install, it is possible that your computer isn’t looking in the right place.

To see whether my assumption is correct, first check if /users/me/.npm-global/bin is in your path.

echo $PATH

If it isn’t there, you will need to add it to the path. Open up ~/.bash_profile then add the following line to the bottom:

# NPM global installs
export PATH=$PATH:~/.npm-global/bin

Finally, back in the shell, type:

source ~/.bash_profile

Hopefully that will have fixed your problem


Tried multiple solutions and still failed. "expo command not found" on mac
#3

That worked! Thank you so much for your help.


closed #4

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.