Issue
I am trying to install Composer and Drush on my Mac for my Drupal website, but am running into an issue whenever I try to actually run a Drush command.
I followed these instructions to download and install composer and Drush, however, when I go to run a Drush command I get an error saying Drush is not found.
I believe the main issue is that export PATH="$HOME/.composer/vendor/bin:$PATH"
does not work since my .composer
directory doesn't have a vendor
folder in it.
So somehow, when I ran brew install composer
there was no vendor
folder created, all that was created was a cache directory.
Why is the vendor folder missing after installing using brew?
Solution
Ensure composer is installed correctly
You have installed composer
on your macOS system with the command:
brew install composer
Ensure composer is installed and found in your PATH
by running:
which composer
composer --version
Installing drush
Add composer's global
bin-dir
to yourPATH
environment variableexport PATH="$(composer --global config --absolute bin-dir):${PATH}:"
Install
drush
with the following command:composer global require drush/drush
Verify
drush
has been installed correctlywhich drush drush --version
To persist the changes to your PATH
add the line from 1.
to your shell's startup files (i.e. ~/.bashrc
for bash or ~/.zshrc
for zsh
). Afterwards start a new shell-session.
Answered By - Nicolai Fröhlich
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.