Composer won't run globally <p>Using macOS Sierra and trying to install Composer globally.</p> <p>I've followed all these instructions: <a href="http://stackoverflow.com/questions/11333230/how-to-run-composer-from-anywhere">How to run composer from anywhere?</a> and none of them work.</p> <p>Starting afresh I've done this:</p> <ol> <li><p>Terminal > In my home directory (<code>$ cd ~</code>) </p></li> <li><p><code>curl -sS <a href="https://getcomposer.org/installer" rel="nofollow">https://getcomposer.org/installer</a> | sudo php -- --install-dir=/usr/local/bin --filename=composer</code></p></li> <li><p>Reported as a successful installation. Message is: <b>Composer successfully installed to: /usr/local/bin/composer </b></p></li> <li><p><code>$ composer -v -bash: /usr/local/bin/composer/: Not a directory</code></p></li> </ol> <p>When I navigate to <code>/usr/local/bin</code> I can see composer, and it is indeed the executable rather than a directory:</p> <pre><code>$ cd /usr/local/bin $ ls -l -rwxr-xr-x 1 root wheel 1704783 4 Oct 10:07 composer </code></pre> <p>How can I get this to run globally? </p> <p>Checked my path and it looks ok?</p> <pre><code>$ echo $PATH /usr/local/php5/bin:/usr/local/php5/bin:/usr/local/bin: /usr/bin:/bin:/usr/sbin:/sbin </code></pre>