tuyakhov / yii2-braintree

Integrate a credit card payment form with Braintree's API into Yii2
3 stars 11 forks source link

Problem with installing yii2-braintree in Yii 2 #6

Closed lx4r closed 9 years ago

lx4r commented 9 years ago

Hey, I added "tuyakhov/yii2-braintree": "*"to my composer.json which already contains "braintree/braintree_php" : "3.5.0" and ran composer update. I got this error message:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for tuyakhov/yii2-braintree * -> satisfiable by tuyakhov/yii2-braintree[1.0.1].
    - tuyakhov/yii2-braintree 1.0.1 requires npm-asset/braintree-web 2.10.* -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

After some research in the composer repos I added "npm-asset/braintree-web": "2.10.*" to the composer.json but that didn't help.

What am I doing wrong?

Thanks in advance for the help lx4r

dmitry-kulikov commented 9 years ago

Can you show minimal composer.json which reproduces issue? Based on your description I created such composer.json https://gist.github.com/dmitry-kulikov/1b2434fe41849eb109bd, it works correct.

tuyakhov commented 9 years ago

@dmitry-kulikov Thanks for reply. Works fine for me as well. @lx4r could you, please, attach your compose.json

lx4r commented 9 years ago

@dmitry-kulikov @tuyakhov Thanks for the fast reply. The files you requested plus additional information:

  1. My working composer.json, before I added the braintree component: https://gist.github.com/lx4r/bdf81562c4fb9444a0e5
  2. The composer.json I want to use: https://gist.github.com/lx4r/35ed1ddabd6b2c879d0d
  3. The minimal composer.json that reproduces the issue: https://gist.github.com/lx4r/8040a2a8b1f88c788ffe
    Versions 2 and 3 trigger the error I mentioned in the first post.

Thank you so much for helping me lx4r

dmitry-kulikov commented 9 years ago

All three composer.json files work for me. Try to find issue in your composer installation. I guess you have composer installed globally. Try to update composer composer self-update. Also check composer plugins in ~/.composer. They are not updated during composer self-update. Yii recommends to install fxp/composer-asset-plugin, currently documentation contains command composer global require "fxp/composer-asset-plugin:~1.0.3" http://www.yiiframework.com/doc-2.0/guide-start-installation.html#installing-via-composer, they update documentation from time to time, so you could stuck with old version of plugin. In ~/.composer/composer.lock you can check your version of plugins. You can run composer update in .composer directory to update plugins.

lx4r commented 9 years ago

@dmitry-kulikov Thanks a lot, you solved my problem. It seems I forgot to apply composer global require "fxp/composer-asset-plugin:~1.0.3" when I installed Yii 2. After doing so the composer file including the braintree component worked fine.

Thanks again and stay awesome! lx4r