PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, February 19, 2022

[FIXED] Vendor folder missing after using brew to install Composer

 February 19, 2022     composer-php, drush, homebrew, php     No comments   

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

  1. Add composer's global bin-dir to your PATH environment variable

    export PATH="$(composer --global config --absolute bin-dir):${PATH}:"
    
  2. Install drush with the following command:

    composer global require drush/drush
    
  3. Verify drush has been installed correctly

    which 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
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing