How to fix Composer Command not found
The error message "bash: composer: command not found" indicates that the Composer executable is not found in your system's PATH. Since you installed Composer by downloading the composer.phar
file, you need to either run it directly using PHP or move it to a directory that is included in your PATH for easier access. Composer is the PHP dependency manager. Whenever your site or application needs third-party code or libraries, it's generally a good idea to include them with Composer. After all, if your code requires a library, and that library requires another one, Composer will manage that for you.
Here are a few options to resolve this:
Run Composer directly: Since you have
composer.phar
in your home directory, you can run it using the following command:Move Composer to
/usr/local/bin
: To make Composer globally accessible, you can move thecomposer.phar
to a directory that is included in your PATH. Here’s how you can do it:After doing this, you should be able to run Composer simply by typing:
Check your PATH: If you need to check which directories are included in your PATH, you can use:
Ensure that
/usr/local/bin
is included in the output.
After following one of these methods, Composer should be accessible from any directory in your terminal session.
Conclusion
If you followed all the steps in this guide correctly, the newly completed Laravel installation will allow you to start a new application.
Post a Comment
0Comments