使用国内composer镜像安装项目报错

其实从来没用comopser安装成功过。问题和过程如下:

1、在windows上用http://docs.phpcomposer.com/Composer-Setup.exe 安装composer
2、Wamp、php都已经安装好openssl也打开。
3、新建一个目录,里面放了composer.json,内容如下:

{
  "name": "karpoff/yii2-crop-image-upload",
  "description": "Yii 2 Crop image upload widget",
  "homepage": "https://github.com/karpoff/yii2-crop-image-upload",
  "license": "BSD-3-Clause",
  "type": "yii2-extension",
  "version": "0.0.1",
  "keywords": ["yii2", "crop", "image", "upload"],
  "authors": [
    {
      "name": "Anton Karpov",
      "email": "karpoff@bk.ru"
    }
  ],
  "autoload": {
    "psr-4": {
      "karpoff\\icrop\\": ""
    }
  },
  "require": {
    "yiisoft/yii2": "*",
    "yiisoft/yii2-imagine": "*",
    "mongosoft/yii2-upload-behavior": "*"
  },
  "repositories": [
    {"type": "composer", "url": "http://pkg.phpcomposer.com/repo/packagist/"},
    {"packagist": false}
]
}

4、然后右键点击,选 "Composer Install",报错:

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

  Problem 1
    - yiisoft/yii2 2.0.1 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stabl
e -> no matching package found.
    - yiisoft/yii2 2.0.0 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stabl
e -> no matching package found.
    - yiisoft/yii2 2.0.1 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stabl
e -> no matching package found.
    - yiisoft/yii2 2.0.0 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stabl
e -> no matching package found.
    - Installation request for yiisoft/yii2 * -> satisfiable by yiisoft/yii2[2.0
.0, 2.0.1].

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

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

5、求安慰

阅读 32.6k
2 个回答

你漏装了fxp/composer-asset-plugin
composer装上这个就行了
仔细看教程啊。。。

新手上路,请多包涵

composer global require "fxp/composer-asset-plugin:~1.1.1" 这是具体的执行命令

宣传栏