I don't know if this question has been asked, because searching finds results mostly about moving the libraries installation directory.
I have a globally installed composer command. Is there a way to run, for example, composer install
in a different directory than current, i.e. to specify the directory in which I would like tu run the command?
E.g. being in /home/someuser
, I would like to acquire the same result as in running composer install
it inside /home/someuser/myproject
. Of course, one way would be to simply change the current directory, run composer and go back.
Try composer install -h . There you'll find an option --working-dir (or -d ). And that's what you're looking for.
Alternatively, as mentioned before, keeping the globally installed composer regularly updated. Show activity on this post. I would always suggest install globally, it will be easier for you to manage, and you could easily keep it up to date.
Try composer install -h
. There you'll find an option --working-dir
(or -d
). And that's what you're looking for.
Then run:
composer install --working-dir=/home/someuser/myproject
You can find more in composer docs.
Depending on your operating system, the =
might need to be removed:
composer install --working-dir /home/someuser/myproject
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With