【问题标题】:could not create yii2 project with composer无法使用 composer 创建 yii2 项目
【发布时间】:2018-03-10 15:29:45
【问题描述】:

我正在尝试使用 composer 创建一个 yii2 项目并收到此错误

我使用的是 ubuntu 16.04 LTS

错误: https://pastebin.com/XgSt9Z2B

  root@xuf-SATELLITE-C50t-A:/var/www/html/suppare# composer create-project --prefer-dist yiisoft/yii2-app-basic suppare
    Do not run Composer as root/super user! See https://getcomposer.org/root for details
    Installing yiisoft/yii2-app-basic (2.0.14)
      - Installing yiisoft/yii2-app-basic (2.0.14): Loading from cache
    Created project in suppare
    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
    - codeception/phpunit-wrapper 6.0.2 requires sebastian/diff ^3.0 -> satisfiable by sebastian/diff[3.0.0].
    - codeception/phpunit-wrapper 7.0.0 requires sebastian/diff ^3.0 -> satisfiable by sebastian/diff[3.0.0].
    - codeception/phpunit-wrapper 7.0.1 requires sebastian/diff ^3.0 -> satisfiable by sebastian/diff[3.0.0].
    - codeception/phpunit-wrapper 7.0.2 requires sebastian/diff ^3.0 -> satisfiable by sebastian/diff[3.0.0].

在上述错误之前,我收到了 php-mbstring 的扩展错误,所以运行了这个命令,现在我得到了上述错误。作曲家创建了不完整的项目,但出现了错误,不会出现在浏览器上 sudo apt-get install php-mbstring

【问题讨论】:

  • 能否确认你使用的是哪个php版本,cli上运行的是哪个php版本,你还没有添加你运行的命令
  • @MuhammadOmerAslam 问题已解决,我使用的是 php7 btw,我运行的命令在上面的代码中。
  • 是的,我怀疑很高兴知道你解决了它

标签: ubuntu yii2 composer-php lamp


【解决方案1】:

好像没有phpunit所以我跑了

sudo apt-get install phpunit

它解决了这个问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-30
    • 1970-01-01
    • 1970-01-01
    • 2016-07-07
    • 2016-04-07
    • 2017-09-23
    相关资源
    最近更新 更多