Drupal 8 only searches for connected libraries in certain directories. I have a library

composer require components/chosen 

installed in the vendor/components/chosen directory

    1 answer 1

    The answer is found here composer is ignoring installer-paths configuration

    As you know, you can specify your custom directory using Custom Install Paths

     "extra": { "installer-paths": { "your/custom/path/{$name}/": ["type:drupal-library"] } } 

    But in this library, the type is equal to component, and this type does not support extra "installer-paths". And it can not be installed in a separate directory.

    The solution was the package

     composer require oomphinc/composer-installers-extender 

    After installing it, you can add type "component" and specify "installer-paths" by the name of the library.

     "extra": { "installer-types": ["component"], "installer-paths": { "web/libraries/{$name}": ["type:drupal-library", "components/chosen"], } }