puro icon indicating copy to clipboard operation
puro copied to clipboard

Installation instructions do not work: Powershell Execution Policy needs to be set to `RemoteSigned`

Open AMDphreak opened this issue 7 months ago • 1 comments

puro flutter doctor doesn't work on Windows. Your instructions include no mention of changing the Powershell Execution Policy. Let's be real: nobody is using cmd.exe on Windows as a developer, so you have to include this:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

These are the error messages if you do not do the above first:

PS C:\Users\rjamd> puro flutter doctor
[E] powershell: Import-Module : File C:\program
    files\powershell\7\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShell.Archive.psm1 cannot be loaded because
    running scripts is disabled on this system. For more information, see about_Execution_Policies at
    https:/go.microsoft.com/fwlink/?LinkID=135170.
    At line:1 char:1
    + Import-Module Microsoft.PowerShell.Archive; Expand-Archive C:\Users\r ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : SecurityError: (:) [Import-Module], PSSecurityException
        + FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand
    Expand-Archive : The 'Expand-Archive' command was found in the module 'Microsoft.PowerShell.Archive', but the module
    could not be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Archive'.
    At line:1 char:45
    + Import-Module Microsoft.PowerShell.Archive; Expand-Archive C:\Users\r ...
    +                                             ~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (Expand-Archive:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule


[E] Exception while Pre-caching engine
[E] Assertion failed: "powershell subprocess failed with exit code 1"
    #0      runProcess (package:puro/src/process.dart:121)
    <asynchronous suspension>
    #1      unzip (package:puro/src/env/engine.dart:154)
    <asynchronous suspension>
    #2      downloadSharedEngine.<anonymous closure> (package:puro/src/env/engine.dart:266)
    <asynchronous suspension>
    #3      ProgressNode.wrap (package:puro/src/progress.dart:68)
    <asynchronous suspension>
    #4      downloadSharedEngine (package:puro/src/env/engine.dart:264)
    <asynchronous suspension>
    #5      createEnvironment.<anonymous closure>.<anonymous closure> (package:puro/src/env/create.dart:238)
    <asynchronous suspension>
    #6      runOptional (package:puro/src/logger.dart:173)
    <asynchronous suspension>

[=========      ] Cloning https://github.com/flutter/flutter.git

AMDphreak avatar Jul 11 '25 05:07 AMDphreak

Installation still fails even after changing Execution Policy:

PS C:\Users\rjamd> Invoke-WebRequest -Uri "https://puro.dev/builds/1.4.11/windows-x64/puro.exe" -OutFile "$env:temp\puro.exe"; &"$env:temp\puro.exe" install-puro --promote
[✓] Updated PATH in the Windows registry, reopen your terminal for it to take effect
[✓] Successfully installed Puro 1.4.11 to `C:\Users\rjamd\.puro`
PS C:\Users\rjamd> puro flutter doctor
[E] powershell: Import-Module : File C:\program
    files\powershell\7\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShell.Archive.psm1 cannot be loaded because
    running scripts is disabled on this system. For more information, see about_Execution_Policies at
    https:/go.microsoft.com/fwlink/?LinkID=135170.
    At line:1 char:1
    + Import-Module Microsoft.PowerShell.Archive; Expand-Archive C:\Users\r ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : SecurityError: (:) [Import-Module], PSSecurityException
        + FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand
    Expand-Archive : The 'Expand-Archive' command was found in the module 'Microsoft.PowerShell.Archive', but the module
    could not be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Archive'.
    At line:1 char:45
    + Import-Module Microsoft.PowerShell.Archive; Expand-Archive C:\Users\r ...
    +                                             ~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (Expand-Archive:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule


[E] Exception while Pre-caching engine
[E] Assertion failed: "powershell subprocess failed with exit code 1"
    #0      runProcess (package:puro/src/process.dart:121)
    <asynchronous suspension>
    #1      unzip (package:puro/src/env/engine.dart:154)
    <asynchronous suspension>
    #2      downloadSharedEngine.<anonymous closure> (package:puro/src/env/engine.dart:266)
    <asynchronous suspension>
    #3      ProgressNode.wrap (package:puro/src/progress.dart:68)
    <asynchronous suspension>
    #4      downloadSharedEngine (package:puro/src/env/engine.dart:264)
    <asynchronous suspension>
    #5      createEnvironment.<anonymous closure>.<anonymous closure> (package:puro/src/env/create.dart:238)
    <asynchronous suspension>
    #6      runOptional (package:puro/src/logger.dart:173)
    <asynchronous suspension>

[W] Elevating to create a symlink, please enable developer mode in Windows settings to avoid this workaround
[E] powershell: Import-Module : File C:\program
    files\powershell\7\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShell.Archive.psm1 cannot be loaded because
    running scripts is disabled on this system. For more information, see about_Execution_Policies at
    https:/go.microsoft.com/fwlink/?LinkID=135170.
    At line:1 char:1
    + Import-Module Microsoft.PowerShell.Archive; Expand-Archive C:\Users\r ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : SecurityError: (:) [Import-Module], PSSecurityException
        + FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand
    Expand-Archive : The 'Expand-Archive' command was found in the module 'Microsoft.PowerShell.Archive', but the module
    could not be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Archive'.
    At line:1 char:45
    + Import-Module Microsoft.PowerShell.Archive; Expand-Archive C:\Users\r ...
    +                                             ~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (Expand-Archive:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule


[x] Assertion failed: "powershell subprocess failed with exit code 1"
    #0      runProcess (package:puro/src/process.dart:121)
    <asynchronous suspension>
    #1      unzip (package:puro/src/env/engine.dart:154)
    <asynchronous suspension>
    #2      downloadSharedEngine.<anonymous closure> (package:puro/src/env/engine.dart:266)
    <asynchronous suspension>
    #3      ProgressNode.wrap (package:puro/src/progress.dart:68)
    <asynchronous suspension>
    #4      downloadSharedEngine (package:puro/src/env/engine.dart:264)
    <asynchronous suspension>
    #5      setUpFlutterTool.<anonymous closure> (package:puro/src/env/flutter_tool.dart:119)
    <asynchronous suspension>
    #6      checkAtomic.<anonymous closure> (package:puro/src/file_lock.dart:238)
    <asynchronous suspension>
    #7      lockFile (package:puro/src/file_lock.dart:68)
    <asynchronous suspension>
    #8      checkAtomic (package:puro/src/file_lock.dart:236)
    <asynchronous suspension>
    #9      setUpFlutterTool (package:puro/src/env/flutter_tool.dart:110)
    <asynchronous suspension>
    #10     createEnvironment (package:puro/src/env/create.dart:283)
    <asynchronous suspension>
    #11     _getPseudoEnvironment (package:puro/src/env/default.dart:22)
    <asynchronous suspension>
    #12     FlutterCommand.run (package:puro/src/commands/flutter.dart:29)
    <asynchronous suspension>
    #13     CommandRunner.runCommand (package:args/command_runner.dart:212)
    <asynchronous suspension>
    #14     main (package:puro/src/cli.dart:288)
    <asynchronous suspension>

[x] Puro crashed! Please file an issue at https://github.com/pingbird/puro
    Consider running the command with a higher log level: `--log-level=4`

AMDphreak avatar Jul 11 '25 05:07 AMDphreak

Seems like a duplicate of https://github.com/pingbird/puro/issues/89

pingbird avatar Nov 27 '25 05:11 pingbird