Skip to content
Advertisement

Can’t move composer

When I install composer on my mac with:

curl -sS https://getcomposer.org/installer | php

And then try to move it like this:

sudo mv php composer.phar /usr/local/bin/composer

it’s telling me:

rename composer.phar to /usr/local/bin/composer: No such file or directory

When I look to my path:

echo $PATH

It’s telling me:

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

That can’t be right I guess, I’m not very familiair with composer what should I do?

Thankyou

Advertisement

Answer

Try with below command to install composer globally.

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Note: On some versions of OSX the /usr directory does not exist by default. If you receive the error “/usr/local/bin/composer: No such file or directory” then you must create the directory manually before proceeding: sudo mkdir -p /usr/local/bin.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement