简体   繁体   中英

ZSH: Command not found - after update macOS to 10.15.1

Yesterday I was using all my installed packages without any problem such as mysql , composer , php , brew and co...

However, today I started my MacBook and typed mysql and I got: zsh: command not found: mysql . Not even brew is working anymore and I don't know why.. this is my .zshrc config file and I don't know why it isn't working.

# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:~/.composer/vendor/bin:$PATH

Any ideas how to fix this?

Yuck, how did that happen? Try this:

PATH=/bin:/usr/bin:/usr/local/bin:$PATH
export PATH

Whether this works is going to depend on where you have been installing user executables. If you're using homebrew, I would expect it to be /usr/local/bin but perhaps it is something different in your case? You might want to try putting /usr/local/bin first so things installed by homebrew get picked up before the defaults in /usr/bin and /bin (this is what I do, and I'm still alive to talk about it...)

You could also change your default shell back to Bash:

brew install bash
echo '/usr/local/bin/bash' >> /etc/shells
chsh

You might need to use sudo on line 2.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM