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

Saturday, January 1, 2022

[FIXED] Has composer global path changed (from 1.x to 2.0)

 January 01, 2022     composer-php     No comments   

Issue

I recently upgraded composer to the new version (on a Ubuntu 18.04 machine) and everything seemed to work fine until I tried to composer global require a package. It was installed correctly but when I tried to call it, my bash says command not found (I had some globally installed packages before and they were working as expected)

After some digging, I found that my new package was not installed in $HOME/.composer/vendor/bin (this was part of my $PATH) but rather in $HOME/.config/composer/vendor/bin.

My question is : does the new version use a different directory for installing global packages (I couldn't find anything in the docs or any other online resource about that) or is something wrong with my setup ? (if so how can I track it down ?)


Solution

One way to find out would be using the config command:

composer global config --list and look for bin-dir

Or as a one liner if you prefer: composer global config --list | grep bin-dir



Answered By - Manuel Garcia
  • 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