Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sh: composer: command not found when running build:project:create #165

Closed
rushhourmedia opened this issue Jan 24, 2019 · 9 comments
Closed
Labels

Comments

@rushhourmedia
Copy link

This may be user error on my part, I'm not sure - but I am receiving the following when I try and run build:project:create:

terminus build:project:create --team="My Team" d8 my-site --git=bitbucket

 Enter the password you would like to use to log in to your test site,
 or leave empty for a random password::
 > 

 [notice] Create a local working copy of pantheon-systems/example-drops-8-composer
 [notice] Creating project and resolving dependencies.
 [notice] Running composer create-project --working-dir=/private/var/folders/xy/w9egr69w7er6wwer897erg/T/local-sitezDR0R8 pantheon-systems/example-drops-8-composer my-site -n 
sh: composer: command not found
 [error]  Command `composer create-project --working-dir=/private/var/folders/xy/w9egr69w7er6wwer897erg/T/local-sitezDR0R8 pantheon-systems/example-drops-8-composer my-site -n ` failed with exit code 127

Any help appreciated

@stevector
Copy link
Collaborator

My understanding is that this tool relies on the copy of composer running already on a machine. Do you have Composer installed?

@ataylorme
Copy link
Contributor

sh: composer: command not found
My understanding is that this tool relies on the copy of composer running already on a machine.

Yes, build tools needs git and Composer (in addition to Terminus and the build tools plugin) to run. Composer can be downloaded from https://getcomposer.org/

@Farnoosh63
Copy link

I was getting the same error and I had composer installed locally. Here was my alias setup on bash/Zsh profile to execute composer. alias composer="php /usr/local/bin/composer.phar"
I moved composer.phar to /usr/local/bin/ mv composer.phar /usr/local/bin/composer then made composer executable by running sudo chmod +x /usr/local/bin/composer
This fixed my composer installation and terminus is using installed composer on my machine.

@greg-1-anderson
Copy link
Member

composer must be in your $PATH; the Terminus Build Tools plugin cannot utilize aliases to run Composer commands.

@szipfel
Copy link

szipfel commented Aug 14, 2019

I fixed this by adding a symbolic link 'composer' in the directory where composer.phar lives pointing to the composer.phar file (ln -s composer.phar composer) and the Terminus Build Tools plugin found it.

@agm1984
Copy link

agm1984 commented May 6, 2020

I had composer.phar in /usr/local/bin, and I had alias composer="php /usr/local/bin/composer.phar".

I followed Farnoosh63's recommendation of:

cd /usr/local/bin
mv composer.phar composer
sudo chmod +x composer

And it made my NPM script in package.json work properly again.

@rkelsey76
Copy link

```shell
sudo chmod +x composer

This worked for me :-)

@castroalves
Copy link

@agm1984 also worked for me. Thanks!

@jimthunderbird
Copy link

jimthunderbird commented Sep 5, 2022

For my experience, i did the following:

cd ~/.composer/vendor/bin
ln -s [path-to-composer.phar] composer

it will then works

Because in .composer/vendor/bin/laravel, it has the following code:

$GLOBALS['_composer_bin_dir'] = __DIR__;

we need to make sure laravel can find composer executable in .composer/vendor/bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants