2016-04-24 13 views
4

vendor/ディレクトリを削除してcomposer updateを削除しましたが、エラーが表示されます。 Yii2プロジェクトで 'composer update'を実行できません:yiisoft/yii2 2.0.7にbower-asset/jqueryが必要です。2.2.*@stable

$ composer update 
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 
    - The requested package bower-asset/jquery could not be found in any version, there may be a typo in the package name. 
    Problem 2 
    - yiisoft/yii2 2.0.7 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable -> no matching package found. 
    - yiisoft/yii2 2.0.6 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. 
    - yiisoft/yii2 2.0.5 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. 
    - yiisoft/yii2 2.0.4 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. 
    - yiisoft/yii2 2.0.3 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. 
    - yiisoft/yii2 2.0.2 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. 
    - yiisoft/yii2 2.0.1 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. 
    - yiisoft/yii2 2.0.0 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. 
    - Installation request for yiisoft/yii2 * -> satisfiable by yiisoft/yii2[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7]. 

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://getcomposer.org/doc/04-schema.md#minimum-stability> for more details. 

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

は、私も手動で "bower-asset/jquery": "*",を追加しようとしましたが、それは助けにはなりませんでした。パッケージが存在しているようだということ

composer.json
{ 
    "name": "yiisoft/yii2-app-basic", 
    "description": "Yii 2 Basic Application Template", 
    "keywords": ["yii2", "framework", "basic", "application template"], 
    "homepage": "http://www.yiiframework.com/", 
    "type": "project", 
    "license": "BSD-3-Clause", 
    "support": { 
     "issues": "https://github.com/yiisoft/yii2/issues?state=open", 
     "forum": "http://www.yiiframework.com/forum/", 
     "wiki": "http://www.yiiframework.com/wiki/", 
     "irc": "irc://irc.freenode.net/yii", 
     "source": "https://github.com/yiisoft/yii2" 
    }, 
    "minimum-stability": "stable", 
    "require": { 
     "php": "~5.4", 
     "ext-gd": "*", 
     "ext-soap": "*", 
     "ext-mcrypt": "*", 
     "ext-mbstring": "*", 
     "yiisoft/yii2": "*", 
     "yiisoft/yii2-bootstrap": "*", 
     "yiisoft/yii2-swiftmailer": "*", 
     "yiisoft/yii2-redis": "~2.0", 
     "yiisoft/yii2-debug": "*", 
     "bower-asset/jquery": "*", 
     "exeu/apai-io": "*", 
     "mervick/yii2-mthaml": "*", 
     "googleads/googleads-php-lib": "~6.5" 
    }, 
    "require-dev": { 
     "heroku/heroku-buildpack-php": "*", 
     "yiisoft/yii2-codeception": "*", 
     "yiisoft/yii2-gii": "*", 
     "yiisoft/yii2-faker": "*" 
    }, 
    "config": { 
     "process-timeout": 1800 
    }, 
    "scripts": { 
     "post-create-project-cmd": [ 
      "yii\\composer\\Installer::postCreateProject" 
     ], 
     "compile": "php yii asset assets.php config/assets-prod.php" 
    }, 
    "extra": { 
     "yii\\composer\\Installer::postCreateProject": { 
      "setPermission": [ 
       { 
        "runtime": "0777", 
        "web/assets": "0777", 
        "yii": "0755" 
       } 
      ], 
      "generateCookieValidationKey": [ 
       "config/web.php" 
      ] 
     }, 
     "asset-installer-paths": { 
      "npm-asset-library": "vendor/npm", 
      "bower-asset-library": "vendor/bower" 
     } 
    }, 
    "autoload": { 
     "classmap": [ 
     "vendor/googleads/googleads-php-lib/src/Google/Api/Ads/Common/Util" 
     ] 
    } 
} 

$ composer search bower | grep jquery 
bower-asset/jquery 

答えて

5

あなたが最初

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

このコマンドを実行する必要が作曲を通じて管理亭とNPMパッケージの依存関係を可能に作曲資産プラグインをインストールします。

のYii

の貢献者の1 saidとして我々は2.1でこれを修正するつもりです。

0

私は"bower-asset/jquery": "*"行を削除してからcomposer global require fxp/composer-asset-plugin --no-pluginscomposer update workedを走りました。作曲家は吸うようです。私はそれがRubyのためにgemとしてうまくいったことを望みます。

+0

Composerは吸うが、あなたは作曲が最初の場所でのために構築されていなかったことをやってできるようにプラグインのクリエイターはありません。 'fxp/composer-asset-plugin'を非難してください。 – Sven

0

プラグインを使用してYii2用のBowerをインストールしたくない場合は、yii2-bower-assetを試してみてください。

このパッケージには、BowerとComposerを分離するYii2用のBowerが固定されています。

しかし、Yiiは2.1バージョンではプラグインの代わりにAsset Packagistを使用しますが、現在は使用しません。

https://github.com/yidas/yii2-bower-asset

関連する問題