title: Yii2 with composer and fxp/composer-asset-plugin
body: <p>I'm working on a project using Yii2 PHP framework. Yii2 uses <strong><em>composer</em></strong> with <strong>fxp/composer-asset-plugin</strong> to handle project dependencies.</p>
  
  <p>The problem is when a new developer comes to the project and runs</p>
  
  <pre><code>git clone &lt;project-repo&gt;
  composer install
  </code></pre>
  
  <p>or another developer wants to install a new extension with <code>composer require &lt;package-name&gt;</code> often (very often) something goes wrong and <strong>composer</strong> (or maybe <strong>asset plugin</strong>, I mentioned above) shows another unclear error message (maybe only for me). And the developer spends lots of time to find what that error meant and how to deal with it.</p>
  
  <p>Today I've cloned project on Windows machine, installed the latest <strong>composer</strong> and <strong>asset plugin</strong> versions, run <code>composer install</code> and, after about 20 minutes waiting, got this:</p>
  
  <p><a href="https://i.stack.imgur.com/5aJsh.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/5aJsh.jpg" alt="enter image description here"></a></p>
  
  <p>On my Linux system same dependencies have been installed without errors.</p>
  
  <p><strong>Question №1</strong>
  What does this error mean and how can I fix it?</p>
  
  <p><strong>Question №2</strong>
  Is it so bad idea to add <code>vendor/</code> directory to version control? (I've read <a href="https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md" rel="noreferrer">https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md</a>)</p>
  
  <p><strong>Question №3</strong>
  Maybe I'm doing something wrong or there is a secret, I'm not aware about, that allows to manage dependencies in Yii2 without such huge time loss.</p>
  
  <p>Many thanks.</p>
  
  <p><code>composer.json</code>:</p>
  
  <pre><code>{
      "name": "yiisoft/yii2-app-basic",
      "description": "Yii 2 Basic Project Template",
      "keywords": ["yii2", "framework", "basic", "project 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"
      },
      "repositories": [
          {
              "type": "git",
              "url":  "https://github.com/ZeroVision/swiftmailer.git"
          }
      ],
      "minimum-stability": "dev",
      "require": {
          "php": "&gt;=5.4.0",
          "giggsey/libphonenumber-for-php": "~7.0",
          "yiisoft/yii2": "2.0.7",
          "swiftmailer/swiftmailer": "dev-fixStreamBufferTransport",
          "yiisoft/yii2-bootstrap": "&gt;=2.0.3",
          "yiisoft/yii2-swiftmailer": "*",
          "yiisoft/yii2-authclient": "^2.0@dev",
          "2amigos/yii2-date-picker-widget": "~1.0",
          "kartik-v/yii2-widget-timepicker": "*",
          "kartik-v/yii2-widget-rating": "*",
          "2amigos/yii2-gallery-widget": "~1.0",
          "2amigos/yii2-ckeditor-widget": "~1.0",
          "uran1980/yii2-scroll-to-top": "dev-master",
          "yii-cms/yii2-robokassa": "^1.1",
          "onokumus/metismenu": "v2.4.2",
          "rmrevin/yii2-fontawesome": "*",
          "dektrium/yii2-user": "*",
          "p2made/yii2-sb-admin-theme": "1.1.2",
          "p2made/yii2-p2y2-things": "*",
          "p2made/yii2-asset-collection": "*",
          "demi/image": "~1.0",
          "demi/cropper": "~1.0",
          "cyneek/yii2-widget-upload-crop": "dev-master",
          "Nemmo/yii2-attachments": "*",
          "2amigos/yii2-file-input-widget": "*",
          "rkit/yii2-ajaxform-plugin": "^0.0.4",
          "nsept/yii2-birthday-picker": "*",
          "bryglen/yii2-apns-gcm": "1.0.4"
      },
      "require-dev": {
          "yiisoft/yii2-codeception": "*",
          "yiisoft/yii2-debug": "*",
          "yiisoft/yii2-gii": "*",
          "yiisoft/yii2-faker": "*"
      },
      "config": {
          "process-timeout": 1800
      },
      "scripts": {
          "post-create-project-cmd": [
              "yii\\composer\\Installer::postCreateProject"
          ]
      },
      "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"
          }
      }
  }
  </code></pre>