DEV Community

Pete Schwager
Pete Schwager

Posted on

Where'd composer go?

This is just a short post for anyone that may have experienced something I encountered recently.

I have several shortcuts/aliases for quick terminal commands and I noticed that when I was running a composer update on a project, it would say composer is not found. I was confused because I've used composer hundreds of times on this machine and never had an issue. I was racking my brain to figure out what could have happened, then it dawned on me. ZSH.

I had recently upgraded my mac terminal as well as my linux box terminal to use ZSH instead of bash and discovered that the .bash_profile settings no longer work. So if you are experiencing this same issue, the solution is super simple. Just copy all those commands you have stored in .bash_profile and either open or create a .zshrc file in the same folder as your .bash_profile and paste all those commands in there, save, and restart your terminal! That's it. You're aliases are back now!

Top comments (2)

Collapse
 
moopet profile image
Ben Sinclair

If you put your aliases into a file called .aliases and then add

[ -f "$HOME/.aliases" ] && . "$HOME/.aliases"

to each of your shell startup scripts (.bash_profile or .bashrc, .zshrc) then you can have one central place manage them.

Collapse
 
theschwag profile image
Pete Schwager

Nice. I like that! Thanks for sharing