3

I am using Composer v1.10.6 and am trying to get the dependencies to install into a specific folder. File structure is like this:

/some-folder
composer.json
composer.lock

So I want the dependencies defined in composer.json to be installed under /some-folder/vendor, but they are just getting installed to /vendor. What property do I add to composer.json to make this happen? I see there used to be a target-dir property, but it is deprecated.

I want to do this in composer.json so I can install dependencies just with composer install, not something like composer install --dir=/some-folder.

Thank you.

Alan P.
  • 2,898
  • 6
  • 28
  • 52
  • Does this answer your question? [How to specify Composer install path?](https://stackoverflow.com/questions/11883374/how-to-specify-composer-install-path) – Nico Haase Jun 08 '20 at 07:52

1 Answers1

3

Try setting config.vendor-dir in your composer.json like this:

{
    "config": {
        "vendor-dir": "some-folder"
    }
}
Marco
  • 7,007
  • 2
  • 19
  • 49