ZSH: command not found: composer

ZSH: command not found: composer

If you see the error "ZSH: command not found: composer," it means that the composer command is not available in your current shell. This can happen if you have not installed Composer on your system or if Composer is not in your shell's PATH.

To fix this error, you must install Composer if you have not already done so. You can do this by following the instructions on the Composer website, which can be found here: https://getcomposer.org/download/.

Once Composer is installed, you will need to add it to your PATH so that the composer command is available in your shell. You will need to edit your shell's configuration file to do this. The exact steps for doing this will vary depending on which shell you are using and which operating system you are running.

For example, if you are using the Z shell (zsh) on macOS, you can add Composer to your PATH by editing the .zshrc file in your home directory and adding the following line:

export PATH="$HOME/.composer/vendor/bin:$PATH"

Once you have added this line to your .zshrc file, you will need to run the following command to reload the shell's configuration:

source ~/.zshrc

After running this command, the composer command should be available in your shell, and you should not see the "zsh: command not found: composer" error anymore.

Useful links:

Composer

PHP

Related articles

Ruslan Osipov
Written by author: Ruslan Osipov