Flutter update causing error "Flutter requires PowerShell 5.0 or newer" irrecoverable

1,897

Ok I found that in this script bin\internal\update_dart_sdk.ps1 there is variable $psMajorVersionRequired = 5 I just made it's value 3 and flutter seems working so far. Now "flutter doctor" shows me version 1.22.5 (and as I can see it here it is latest as of now)

Share:
1,897
Atul
Author by

Atul

Updated on December 26, 2022

Comments

  • Atul
    Atul over 1 year

    After I updated flutter (using "flutter update") I start getting an error

    Flutter requires PowerShell 5.0 or newer

    And on my Windows 8, I am not able to install PowerShell 5.0. It is throwing an error

    The update is not applicable

    Now I just want to revert back to older version of flutter (which was working on my system). But I am not able to figure out which flutter version that was working on my PC before upgrade, and which version it became after upgrading. Because for all command line params, flutter is just giving above mentioned PowerShell version error and is quitting.

    Flutter is stuck after upgrade. Any solution?

  • Olaf
    Olaf over 3 years
    Instead of cheating your flutter installation you should urgently upgrade your OS to at least Windows 8.1 or better to Windows 10 and then update Powershell to version 5.1. Alternativly you could install Powershell version 7.1 as this will install next to the Windows Powershell version.
  • Atul
    Atul over 3 years
    @Olaf: There are lots of other software's running for years on this PC. Just for flutter dependency, I wouldn't jeopardies the whole system by upgrading it's OS. By the tweak I mentioned, flutter is running and building apps successfully. That simply means flutter either doesn't really need PS5 or it might need it for specific purpose which I might not came across when building my apps. On the contrary, carefully designed software checks for prerequisite and tell user right before installation or upgrade. Flutter was needing me to upgrade my OS for telling its own version after upgrade.
  • Olaf
    Olaf over 3 years
    Of course this is your decision but you are working with an unsupported OS. Windows 8 does not get updates for 5 years now. That's all I'm saying.
  • I Want Answers
    I Want Answers over 2 years
    If you are struggling to locate your flutter installation, run where flutter dart. That would lead you to where to make the update in this answer