Reputation: 962
I have flutter installed and everything works fairly alight but every time I run a flutter command I get the following message before the command actually runs.
Error: PowerShell executable not found. Either pwsh.exe or PowerShell.exe must be in your PATH.
I added the Powershell.exe path to my PATH variable (both System & User) and also added C:\Windows\System32 as I read that on one of the Github/SO forums. Any idea how to get rid of this? I am following a Udemy course and have followed every instruction to the dot but the instructor does not get this message.
Upvotes: 2
Views: 15024
Reputation: 6163
I had to run flutter upgrade
inside PowerShelL directory
C:\Windows\System32\WindowsPowerShell\v1.0>flutter upgrade
Upvotes: 0
Reputation: 115
In case you encountered this problem and none of the above solutions worked for you. In my case, I set all the environment variables - I am using Windows 10. I even reinstalled flutter; but the problems persisted.
It turns out my Anti Virus had quarantined the Powershell executable file. I had to open the anti virus quarantine chest, restored the Powershell executable and restarted my VS Code.
Problems solved, after three days of searching for solutions.
Upvotes: 0
Reputation: 31
I have lost half a day to solve it and used all instructions on flutter site and and answers about powershell path. It didnt work until add C:\Windows\System32 to Path variable.
Upvotes: 3
Reputation: 416
Add this to user Path variables and system path variables
Add these to Environment System Path Variables
My problem was the missing of 3rd from System path variables.
Upvotes: 10
Reputation: 668
copy the path, for my case, it is "C:\Windows\System32\WindowsPowerShell\v1.0" and pastes it in environment variables as a path
Upvotes: 0
Reputation: 446
Go "Edit environment variables for your account" under "User variables" add to Path this line
C:\Windows\System32\WindowsPowerShell\v1.0
It solved my problem.
Upvotes: 7