Where to find composer's global packages?

后端 未结 9 1485
星月不相逢
星月不相逢 2021-01-30 20:12

For a plugin for Sublime Text I was required to install a composer package globally.

In order to do this I had to run the following command:

composer glo         


        
9条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-30 20:57

    You can use

    composer global config bin-dir --absolute
    

    Example

    PATH=$(composer global config bin-dir --absolute --quiet):$PATH
    

    You need --absolute to get value expanded, and --quiet to discard diagnostics of composer global changing working directory. This was tested with composer 1.10.16 and 2.0.1.

    See https://github.com/composer/composer/issues/9354#issuecomment-716827067

提交回复
热议问题