kenneth-rebello
kenneth-rebello

Reputation: 962

Flutter Command - Powershell.exe not in PATH error message

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

Answers (7)

Danton
Danton

Reputation: 1

I upgraded the PowerShell and everything worked fine!

Upvotes: 0

rubStackOverflow
rubStackOverflow

Reputation: 6163

I had to run flutter upgrade inside PowerShelL directory

C:\Windows\System32\WindowsPowerShell\v1.0>flutter upgrade

Upvotes: 0

Psalms Kalu
Psalms Kalu

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

Roman Kononykhin
Roman Kononykhin

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

Foysal Khandakar Joy
Foysal Khandakar Joy

Reputation: 416

Add this to user Path variables and system path variables

  1. C:\src\flutter\bin

Add these to Environment System Path Variables

  1. C:\Program Files\Git\cmd
  2. C:\Windows\System32\WindowsPowerShell\v1.0\
  3. C:\Windows\System32

My problem was the missing of 3rd from System path variables.

Upvotes: 10

Akhil
Akhil

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

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

Related Questions