I've installed the expo CLI and am trying to use expo init to start a project. When I do, this is returned:
bash: expo: command not foundI saw that this required updating the .bash_profile with export PATH=$PATH:~/node_modules.
However, apparently Mac OS Catalina switched from .bash_profile to zprofile or zshrc. Advice online said one should instead add PATH=$PATH:~/node_modules to the end of zshrc.
I tried doing this, but it says the file is locked. When I try to edit it, this pops up:
You don’t own the file “zshrc” and don’t have permission to write to it.
Any ideas how to move forward to fix this?
P.S. I installed anaconda a while ago and saw that the .bash_profile had this:
# added by Anaconda3 5.0.1 installer
export PATH="~/anaconda3/bin:$PATH"
# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
PATH="~/Frameworks/"
export PATHThis might be a problem? I updated the file with the new path, but expo still was not recognized. That's when I found out Catalina switched to zprofile & zshrc.
I've been stuck on this for a long time and tried a bunch of things -- any advice would be greatly appreciated!
11 Answer
You're not using ZSH, if you were, you'd get zsh: command not found: expo. You could either switch to using zsh using chsh or keep using Bash.
Then you should add the PATH modifications (export PATH ...) to the appropriate shell config file .bash_profile or .zshenv, by running sudo vim ~/.bash_profile or sudo vim ~/.zshenv, or if you have VSCode, its probably easier with sudo code ~/.zshrc