Answers.Body: <p>This ended up being a bug we were able to work-around on our side via our web service calls.</p>
  <p>If you restore your site from a pre-update attempt database backup and composer.json file, then attempt the update again, it should go through fine.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-10T20:34:47.113Z
Answers.LastActivityDate: 2020-08-10T20:34:47.113Z
Answers.UserDisplayName: Brad Bell
Answers.Body: <p>I ran into the same issue today with a fairly old project and was able to fix it by rolling back to Composer 1 locally (<code>composer self-update --1</code>), then updating all of the dependencies and reinstalling, then switching back to Composer 2 (<code>composer self-update --2</code>) and running <code>composer install</code> a second time to pick up on any C2-specific changes.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-12T11:49:52.593Z
Answers.LastActivityDate: 2021-10-12T11:49:52.593Z
Answers.UserDisplayName: Dom Stubbs
Body: <p>when I try to update Craft via CLI to 3.5.1. I get the following error:</p>
  <pre><code>Failed to instantiate component or class &quot;yii\shell\Bootstrap
  in /vendor/yiisoft/yii2/di/Container.php:449
  
  Stack trace:
  #0 /vendor/yiisoft/yii2/di/Container.php(374): yii\di\Container-&gt;getDependencies()
  #1 /vendor/yiisoft/yii2/di/Container.php(159): yii\di\Container-&gt;build()
  #2 /vendor/yiisoft/yii2/BaseYii.php(345): yii\di\Container-&gt;get()
  #3 /vendor/yiisoft/yii2/base/Application.php(294): yii\BaseYii::createObject()
  #4 /vendor/craftcms/cms/src/console/Application.php(72): yii\base\Application-&gt;bootstrap()
  #5 /vendor/yiisoft/yii2/base/Application.php(273): craft\console\Application-&gt;bootstrap()
  #6 /vendor/yiisoft/yii2/console/Application.php(124): yii\base\Application-&gt;init()
  #7 /vendor/craftcms/cms/src/console/Application.php(58): yii\console\Application-&gt;init()
  #8 /vendor/yiisoft/yii2/base/BaseObject.php(109): craft\console\Application-&gt;init()
  #9 /vendor/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject-&gt;__construct()
  #10 /vendor/yiisoft/yii2/console/Application.php(89): yii\base\Application-&gt;__construct()
  #11 /vendor/craftcms/cms/src/console/Application.php(48): yii\console\Application-&gt;__construct()
  #12 [internal function]: craft\console\Application-&gt;__construct()
  #13 /vendor/yiisoft/yii2/di/Container.php(400): ReflectionClass-&gt;newInstanceArgs()
  #14 /vendor/yiisoft/yii2/di/Container.php(159): yii\di\Container-&gt;build()
  #15 /vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container-&gt;get()
  #16 /vendor/craftcms/cms/bootstrap/bootstrap.php(245): yii\BaseYii::createObject()
  #17 /vendor/craftcms/cms/bootstrap/console.php(51): require('/var/www/client...')
  #18 /craft(21): require('/var/www/client...')
  #19 {main}
  </code></pre>
  <p>does anyone know what to do about it?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-08-10T09:47:10.923Z
Comments.Text: Try to remove/rename your `vendor` folder then run `composer clearcache` then `composer install`
Comments.UserDisplayName: Oli
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-08T22:20:47.853Z
Comments.Text: @Oli This got me out of a jam. Thanks!
Comments.UserDisplayName: JP.
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-10-18T12:29:02.467Z
Comments.Text: @Oli 's suggestion helped me when I had a similar error updating via CLI to 3.7.40.1. Thanks!
Comments.UserDisplayName: Kirk Roberts
Tags: <craft3><updates>
Title: Craft 3.5.1 CLI Update Error: Failed to instantiate component or class "yii\shell\Bootstrap"
ThreadText: # Craft 3.5.1 CLI Update Error: Failed to instantiate component or class "yii\shell\Bootstrap"
  
  (Asked by: username_0 on 2020-08-10)
  
  when I try to update Craft via CLI to 3.5.1. I get the following error:
  
  ```
  Failed to instantiate component or class "yii\shell\Bootstrap
  in /vendor/yiisoft/yii2/di/Container.php:449
  
  Stack trace:
  #0 /vendor/yiisoft/yii2/di/Container.php(374): yii\di\Container->getDependencies()
  #1 /vendor/yiisoft/yii2/di/Container.php(159): yii\di\Container->build()
  #2 /vendor/yiisoft/yii2/BaseYii.php(345): yii\di\Container->get()
  #3 /vendor/yiisoft/yii2/base/Application.php(294): yii\BaseYii::createObject()
  #4 /vendor/craftcms/cms/src/console/Application.php(72): yii\base\Application->bootstrap()
  #5 /vendor/yiisoft/yii2/base/Application.php(273): craft\console\Application->bootstrap()
  #6 /vendor/yiisoft/yii2/console/Application.php(124): yii\base\Application->init()
  #7 /vendor/craftcms/cms/src/console/Application.php(58): yii\console\Application->init()
  #8 /vendor/yiisoft/yii2/base/BaseObject.php(109): craft\console\Application->init()
  #9 /vendor/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject->__construct()
  #10 /vendor/yiisoft/yii2/console/Application.php(89): yii\base\Application->__construct()
  #11 /vendor/craftcms/cms/src/console/Application.php(48): yii\console\Application->__construct()
  #12 [internal function]: craft\console\Application->__construct()
  #13 /vendor/yiisoft/yii2/di/Container.php(400): ReflectionClass->newInstanceArgs()
  #14 /vendor/yiisoft/yii2/di/Container.php(159): yii\di\Container->build()
  #15 /vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get()
  #16 /vendor/craftcms/cms/bootstrap/bootstrap.php(245): yii\BaseYii::createObject()
  #17 /vendor/craftcms/cms/bootstrap/console.php(51): require('/var/www/client...')
  #18 /craft(21): require('/var/www/client...')
  #19 {main}
  
  ```
  
  does anyone know what to do about it?
  
  **Tags:** craft3, updates
  
  > **Comments:**
  > **username_1**: Try to remove/rename your `vendor` folder then run `composer clearcache` then `composer install`  
  > **username_2**: @username_1 This got me out of a jam. Thanks!  
  > **username_3**: @username_1 's suggestion helped me when I had a similar error updating via CLI to 3.7.40.1. Thanks!  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_4 on 2020-08-10. Score: 3 | Accepted answer
  
  This ended up being a bug we were able to work-around on our side via our web service calls.
  
  If you restore your site from a pre-update attempt database backup and composer.json file, then attempt the update again, it should go through fine.
  
  
  ---
  
  ### Answer by username_5 on 2021-10-12. Score: 2
  
  I ran into the same issue today with a fairly old project and was able to fix it by rolling back to Composer 1 locally (`composer self-update --1`), then updating all of the dependencies and reinstalling, then switching back to Composer 2 (`composer self-update --2`) and running `composer install` a second time to pick up on any C2-specific changes.
  
  
  ---
  
  