The Winget command line lets users manage existing applications and install new ones from a command-line interface in Windows 10 and 11. However, this command line can sometimes not work and show the error message “Winget is not recognized.”
This error usually appears due to reasons like outdated packet manager, missing path environment variable, or disabled Windows packet manager client. Furthermore, you will also get this error on older Windows 10 as the Winget packet manager is not installed by default.
Update App Installer
The Winget package manager comes as a part of the App Installer software on Windows. If you’re running an outdated version of the App Installer, you can get the “Winget is not recognized” error. So, you can try updating the App Installer to fix this issue.
- Click on the Start menu and select All apps.
- Locate Microsoft Store and click on it.
- In Microsoft Store, select the search bar, and search for
App Installer
. - Click on the App installer.
- If an update is available, it should show an Update button. Click on it.
- If you don’t have App Installer on your Windows, it should show an Install button. Click on it to directly download the latest version of the App installer.
- If there is no button beside App Installer, then you’re running the latest version of it.
If you can’t update App Installer from the Microsoft Store, you can manually do so by downloading it from the Github repository. To download the update, click on the latest version name on the top, and download the update file from the assets section at the bottom.
After the setup file downloads, simply run it to update or install Microsoft Winget on your computer.
Enable Windows Package Manager Client
An app execution alias is the declared name for a specific app that can be used to run it from a command line interface. The term Winget is the app execution alias for the Windows packet manager client.
So, if the Windows package manager client is disabled in the app execution alias, the term Winget will not be associated with the Winget package manager. This will result in the error “Winget is not recognized.” Here’s how you can enable it back.
- Press Windows + I shortcut key to open Settings.
- Select Apps from the left sidebar, and click on Advanced app settings.
- Click on App execution aliases.
- Make sure Windows Packet Manager Client is toggled on.
Manually Enter the Path Environment Variable
Whenever you run the Winget command line, it will locate the winget.exe
file using the path environment variable. If your path environment variable hasn’t been created or accidentally deleted, the Winget command won’t be able to locate winget.exe
, and it will result in this error.
So, let’s see how you can manually create the path environment variable and fix this error.
- Open Run utility by pressing Windows + R shortcut key.
- Type
systempropertiesadvanced
and press Enter. - Click on Environment Variables.
- If there is the Path variable name under Variable, follow the steps below:
- Select Path and click on Edit.
- Click on New and type
%UserProfile%\AppData\Local\Microsoft\WindowsApps
in the empty text field. - Press Enter.
- Click Ok and Ok again.
- Select Path and click on Edit.
- If you don’t see the Path variable name under Variable, follow the steps below:
- Click on New.
- Enter
Path
in the Variable name, and enter%UserProfile%\AppData\Local\Microsoft\WindowsApps;
in the Variable value. - Click on OK.
- Press OK and OK again.
- Click on New.
- Restart your computer.