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

composer keeps on saying "You must set up the project dependencies using composer install ..." #7499

Closed
KelvinNjihia opened this issue Jul 27, 2018 · 12 comments
Labels

Comments

@KelvinNjihia
Copy link

I am trying to install composer on Antergos using the official guide.

It has completed without errors without errors.

But whenever composer or composer -V, I keep getting this output.

You must set up the project dependencies using `composer install`
See https://getcomposer.org/download/ for instructions on installing Composer

On going the link and repeating the process or even running composer install, It keeps giving the same output. I want to install composer so that I can be able to install Laravel

@stof
Copy link
Contributor

stof commented Jul 27, 2018

how are you installing composer ?

@KelvinNjihia
Copy link
Author

I am using this official guide provided here. https://getcomposer.org/download/

Just as they are.
screenshot from 2018-07-27 13-39-12

@KelvinNjihia
Copy link
Author

I have found where the issue was, composer isn't working with php version 7.3.0 alpha. Maybe until that issue is resolved.

@Jasu
Copy link

Jasu commented Aug 3, 2018

Does not work in beta either. As a workaround, you can extract the PHAR:

php -r '(new Phar("composer.phar"))->extractTo("composer-extracted");' 

and run Composer with php composer-extracted/bin/composer.

This might be related to https://bugs.php.net/bug.php?id=76510.

@ghost
Copy link

ghost commented Aug 7, 2018

@Jasu

This might be related to https://bugs.php.net/bug.php?id=76510.

fwiw, the workaround there, adding "-fno-optimize-strlen" to build flags, does the trick. with

php -v
	PHP 7.3.0-dev (cli) (built: Aug  7 2018 07:23:47) ( NTS )
	Copyright (c) 1997-2018 The PHP Group
	Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
	    with Zend OPcache v7.3.0-dev, Copyright (c) 1999-2018, by Zend Technologies

composer --version
	Composer version 1.7.1 2018-08-07 09:39:23

no more "You must set up the project dependencies ..." issue.

Will retest once an official 'fix' is in place.

@ktomk
Copy link
Contributor

ktomk commented Dec 26, 2019

Does it make sense to have the "You must set up the project dependencies ..." error message in case composer is packaged as phar? This could constitute a bug as the error message is misleading: Here this is an issue with the PHP runtime and not w/ missing dependencies. The phar package should never miss dependencies hence the error message is wrong.

@videni
Copy link

videni commented Jan 5, 2021

also have this problem on php7.4.13

@ktomk
Copy link
Contributor

ktomk commented Jan 5, 2021

@videni: is composer installed as phar (guess so, just clarifaying). and is this problem new? was there a configuration change like switching xdebug version 2 to xdebug version 3 or something similiar?

/edit: can you provide the exact composer version? and the php version, please check with php --version (or similar). Example:

$ composer --version
Composer version 1.10.17 2020-10-30 22:31:58
$ php7.4 --version
PHP 7.4.13 (cli) (built: Nov 28 2020 06:24:43) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies
    with Xdebug v3.0.1, Copyright (c) 2002-2020, by Derick Rethans

@videni
Copy link

videni commented Jan 6, 2021

@ktomk , thanks for your quick reply, both composer 1.10.19, composer 2.0.8 has the same error on php7.4.13, no xdebug installed

@ktomk
Copy link
Contributor

ktomk commented Jan 6, 2021

@videni can you tell where/how you obtained the php binary on the system where it fails? and perhaps some details about the system. from the original report this was related to how the php binary was compiled. I've also tested with PHP 7.4.13 and for me it's all fine:

$ php7.4 -n -dextension=phar -dextension=json -f $(which composer) -- -V
Composer version 1.10.17 2020-10-30 22:31:58

Using Ubuntu 18.04 and PHP from Sury.org.

@nathandentzau
Copy link

I ran into this today with a project still on PHP 7.4. Defining composer_version: 2.2.10 fixed the issue for me.

@dalin-
Copy link

dalin- commented Apr 4, 2023

Ran into this today within a Docker container. The problem was that composer was also included in the PHP project, and the $PATH points to both the global composer and the project-specific composer, and the first time I ran composer install it failed partway, leaving a corrupted project-specific composer.

The solution was to directly call the global composer to try again. In my case that was /usr/local/bin/composer install. You can probably find it via whereis composer.

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

8 participants