Can't move composer
Solution 1
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.
Solution 2
If you are running macOS Sierra Version, there might not be a /usr/local/bin folder so you will have to create it. Follow these steps in the terminal:
Step 1: cd ~
Step 2: sudo mkdir -p /usr/local/bin
Step 3: curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
Jamie
Updated on September 05, 2022Comments
-
Jamie over 1 year
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