4

I have just cloned and pulled a yii project from yii , I've globally required fxp/composer-asset-plugin:~1.1.1 with this command composer global require "fxp/composer-asset-plugin:~1.1.1" and also globally required fxp/composer-asset-plugin with this command composer global require "fxp/composer-asset-plugin" but when i run composer update to make the vender file and autoload to use the project i get the following error :

Your requirements could not be resolved to an installable set of packages.

And I also get the following error when trying to composer update other projects before the update task :

The "yiisoft/yii2-composer" plugin requires composer-plugin-api 1.0.0, this *WILL* break in the future and it should be fixed ASAP (require ^1.0 for example).

can anyone help to fix these two specially the first one , because I suppose the following problems are related .

(I've also tried reinstalling composer but still got the same errors )

TheDevWay
  • 1,363
  • 1
  • 16
  • 45
  • 1
    remove fxp `composer global remove "fxp/composer-asset-plugin"` and add last version `composer global require "fxp/composer-asset-plugin:*"`. Delete vendor and composer.lock and run composer install. – ineersa Jan 30 '16 at 20:35
  • @ineersa I've done that but still get the same errors , and also when I run the command to the last version it says nothing to install or update . Really don't know that to do – TheDevWay Jan 31 '16 at 05:23
  • Just to inform you, there is an open issue on this at the moment: https://github.com/yiisoft/yii2-composer/issues/4 – Jelmer Keij Feb 04 '16 at 13:07
  • maybe to late but -> http://stackoverflow.com/questions/35009041/yii2-composer-update-fatal-error – efirvida Apr 20 '16 at 16:14

2 Answers2

1

Actually you can do it by

composer global remove "fxp/composer-asset-plugin"

Then delete vendor folder and your composer.lock (you will get all of you executions back in next step).

Then run

composer global require "fxp/composer-asset-plugin:*"

And finally

composer install

If that will not work. Try to delete your global vendor folder. For example, if you are using ubuntu you can find it here /home/someUser/.composer/vendor (this will DELETE ALL packages that were installed globally)

Next run composer global require "fxp/composer-asset-plugin:*" That should work.

0

There is no relation between git and composer except how you config git ignore

did you ignored composer.lock in .gitignore?

I prefer to not do it, keep composer.lock tracked, this will make all the team working on the same version.

did you ignored vendor folder?

I prefer to ignore it, this will reduce size of git pull and push, and no need to push the vendor.

Your requirements could not be resolved to an installable set of packages.

maybe you software dependencies have an incompatible version conflict. you can check this question

The "yiisoft/yii2-composer" plugin requires composer-plugin-api 1.0.0, this WILL break in the future and it should be fixed ASAP (require ^1.0 for example).

Try to remove asses plugin then try install it.

composer global remove “fxp/composer-asset-plugin”
composer global require “fxp/composer-asset-plugin:~1.1.1”

If this not solve the issue, try to do bellow

  1. delete vendor folder then
  2. remove composer.lock
  3. run command composer install
ِAmin
  • 162
  • 1
  • 17