Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use Winget. Winget Not Recognized Error. #725

Closed
Reno-Sifana opened this issue Jan 29, 2021 · 36 comments
Closed

Cannot use Winget. Winget Not Recognized Error. #725

Reno-Sifana opened this issue Jan 29, 2021 · 36 comments
Milestone

Comments

@Reno-Sifana
Copy link

I can't use Winget because the Winget Not Recognized Error when I check in Apps & Features Winget Source is not listed in Apps & Features. I have uninstalled and reinstalled the latest version via GitHub, it's still the same, it doesn't work.

@ghost ghost added the Needs-Triage Issue need to be triaged label Jan 29, 2021
@denelon
Copy link
Contributor

denelon commented Jan 29, 2021

The Windows Package Manager ships as a part of the "App Installer". Once it has been installed, you would access it via the command line. Either CMD or Windows Terminal or any other shell you have installed. You should be able to execute winget, and the output displays the version and the default help.

@denelon denelon added Needs-Author-Feedback Issue needs attention from issue or PR author and removed Needs-Triage Issue need to be triaged labels Jan 29, 2021
@denelon
Copy link
Contributor

denelon commented Jan 29, 2021

Which version of windows are you running?
Which method did you use for installation?

@Reno-Sifana
Copy link
Author

Which version of windows are you running?
Which method did you use for installation?

I am using Windows 10 Version 20H2 x64 bit. I have tried reinstalling via Github and even through the Microsoft store it still doesn't work. By the way, around the end of December 2020, I did a Windows 10 Reset because when the process of uninstalling Avira Antivirus Task Manager suddenly became Blank.

@ghost ghost added Needs-Attention Issue needs attention from Microsoft and removed Needs-Author-Feedback Issue needs attention from issue or PR author labels Jan 29, 2021
@denelon
Copy link
Contributor

denelon commented Jan 29, 2021

Have you joined the Windows Package Manager Insider Program at https://aka.ms/AppInstaller_InsiderProgram ?
If so, when did you submit the form?
Are you logged into the Microsoft Store with that account?
I just pushed the latest update to the store yesterday.
Are there any Group Policies restricting your machine?

@denelon denelon added Needs-Author-Feedback Issue needs attention from issue or PR author and removed Needs-Attention Issue needs attention from Microsoft labels Jan 29, 2021
@Reno-Sifana
Copy link
Author

@denelon hmm yes. I joined and filled out the Windows Package Manager form, and logged into the same Microsoft account that I filled in the Forms. I don't limit restrictions via Group Policy. the error message is like the screenshot below
2021-01-30

@ghost ghost added Needs-Attention Issue needs attention from Microsoft and removed Needs-Author-Feedback Issue needs attention from issue or PR author labels Jan 30, 2021
@pvanberlo
Copy link

@denelon hmm yes. I joined and filled out the Windows Package Manager form, and logged into the same Microsoft account that I filled in the Forms. I don't limit restrictions via Group Policy. the error message is like the screenshot below
2021-01-30

Same issue here. Signed up for the insider a couple of days ago, installed it from the Microsoft Store. No winget, no updates available and so on.

@denelon
Copy link
Contributor

denelon commented Feb 1, 2021

Let me check to see if there are any issues with onboarding to the Insiders program. It's a manual batch run, so you may have just been added or still need to be added in the next batch.

@KevinLaMS
Copy link
Contributor

confirmed, it appears pvanberlo was added earlier this morning.

@KevinLaMS
Copy link
Contributor

Hmmm @Reno-Sifana. You should have already been part of the flight. Let me check actual date and time.

@denelon denelon removed the Needs-Attention Issue needs attention from Microsoft label Feb 1, 2021
@KevinLaMS
Copy link
Contributor

I show that @pvanberlo was completed this AM
and @Reno-Sifana. was completed on 1/25/2021.
@Reno-Sifana if you still have issues, can you email me directly so that i can confirm your email? kevinla@microsoft.com

@pvanberlo
Copy link

Thanks! Just tried again and it's working now :)

@Reno-Sifana
Copy link
Author

Hmmm @Reno-Sifana. You should have already been part of the flight. Let me check actual date and time.

@KevinLaMS hmm. I have joined the Windows Insider Beta Channel / Release Preview Channel since August 2020 to try Windows 10 Version 20H2 earlier.

@Reno-Sifana
Copy link
Author

@denelon my issue has been resolved. because this morning I reinstalled Windows 10 via Bootable Media (USB). And I checked the command "winget" is working now.
the issue is closed now.

@acarlstein
Copy link

I installed App Install from the Microsoft Store.
Then, I closed the command line and reopen a new one.
Winget still not recognized.

The solution provided by Reno-Sifana doesn't work with me because I'm not allowed to reinstall Windows 10.

Could it be that PATH environment variable isn't setup correctly with the path where winget reside?

@denelon
Copy link
Contributor

denelon commented Apr 20, 2021

@acarlstein you might take a look at #210

The Windows Package Manager uses an app execution alias.

@tinonetic
Copy link

To avoid going round in circles :

  1. Go to the application path %userprofile%\AppData\Local\Microsoft\WindowsApps

  2. If winget.exe exists, go to the next step, otherwise make sure you meet conditions or try to download & install the latest appxbundle

  3. Then go to your Environment Variables (if you can't find it, type it on Windows Search)
    image

  4. Click Edit, Environment Variables, Path, New,

  5. Then enter %userprofile%\AppData\Local\Microsoft\WindowsApps\
    image

  6. Click Ok for all dialogs

  7. Open a new command line window (run-as Administrator is best)

  8. Should now work

@mikezcode
Copy link

Yooooo this one works thank you !
Cheers !!

@Reno-Sifana
Copy link
Author

Hi, friends. I'm just watching your comments via e-mail. Because since a few days ago I decided to move from Windows 10 to Linux Mint 20.1 Ulyssa Xfce Edition (based on Ubuntu 20.04 LTS Focal Fossa). I think Moving to Linux Mint is the right decision. Because I'm using an old laptop.
Specification:
Processor: First Generation Intel Core i3 350M (codenamed Arrandale)
RAM: 2GB DDR3
Storage: 320 GB HDD Speed 5400 RPM.

That's it. Thank you.

@manhthang2504
Copy link

To avoid going round in circles :

  1. Go to the application path %userprofile%\AppData\Local\Microsoft\WindowsApps
  2. If winget.exe exists, go to the next step, otherwise make sure you meet conditions or try to download & install the latest appxbundle
  3. Then go to your Environment Variables (if you can't find it, type it on Windows Search)
    image
  4. Click Edit, Environment Variables, Path, New,
  5. Then enter %userprofile%\AppData\Local\Microsoft\WindowsApps\
    image
  6. Click Ok for all dialogs
  7. Open a new command line window (run-as Administrator is best)
  8. Should now work

Solve my problem using this

@denelon
Copy link
Contributor

denelon commented Oct 1, 2021

@manhthang2504 thanks for sharing this. We've also been updating our troubleshooting guide.

@MarkIngramUK
Copy link

I had the same issue today, winget used to work fine, but recently, the environment variable must has just disappeared... Adding it back in fixed the problem.

@denelon
Copy link
Contributor

denelon commented Oct 22, 2021

@MarkIngramUK we've seen a few isolated reports like this. Our current hypothesis is another package is modifying the path environment variable. Would you mind sharing the output of winget list so we can start to see if there is a correlation with other packages?

@MarkIngramUK
Copy link

@denelon I'm wondering if it's related to microsoft/WindowsAppSDK#1599 ? I have WindowsAppSDK preview-1 and preview-2 installed on this machine. I can send winget list but as it's on my work machine I'd prefer to send it privately...

@denelon
Copy link
Contributor

denelon commented Oct 22, 2021

@MarkIngramUK it's possible. No worries. You may be able to submit feedback https://aka.ms/winget-feedback. I believe it will also let you add attachments. So you could attach the output from winget list as a file.

@About7Deaths
Copy link

About7Deaths commented Dec 24, 2021

I am currently on a fresh install of Windows 11 Pro from the ISO image provided by Microsoft.

I was able to properly install winget.exe when it was not found within %userprofile%\AppData\Local\Microsoft\WindowsApps by installing Microsoft.VCLibs.x64.14.00.Desktop.appx (link) followed by Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle (link).

I did not need to make modifications to the environment variables manually after using this method. I also did not need to log into the Microsoft Store / update any apps using the store.

@Loigzorn
Copy link

To avoid going round in circles :

  1. Go to the application path %userprofile%\AppData\Local\Microsoft\WindowsApps
  2. If winget.exe exists, go to the next step, otherwise make sure you meet conditions or try to download & install the latest appxbundle
  3. Then go to your Environment Variables (if you can't find it, type it on Windows Search)
    image
  4. Click Edit, Environment Variables, Path, New,
  5. Then enter %userprofile%\AppData\Local\Microsoft\WindowsApps\
    image
  6. Click Ok for all dialogs
  7. Open a new command line window (run-as Administrator is best)
  8. Should now work

Following these step solved the issue for me too.

@MarkIngramUK we've seen a few isolated reports like this. Our current hypothesis is another package is modifying the path environment variable. Would you mind sharing the output of winget list so we can start to see if there is a correlation with other packages?

Yes I came to the same conclusion.
I recently installed the Java JDK packages. Not through winget though.
But I notices both the packages of Java JDK and the App Installer package set the path/PATH environment variable.
It seems the installation of the Jave JDK has overwritten the earlier set 'path' variable of winget.

To conclude one of the reasons why winget might gives a Winget Not Recognized Error message is the installation process of various other packages, where environment variables are added/edited.
This does not solve the underlaying problem but never the less, the above provided steps give a solution to be able to use the winget package manager again after installing such a package.

@ItzLevvie
Copy link

ItzLevvie commented Dec 25, 2021

I also did not need to log into the Microsoft Store / update any apps using the store.

cc @About7Deaths: Please make sure to update your App Installer from the Microsoft Store to solve a security vulnerability issue—likely being exploited in the wild by malicious actors—that's currently present in the GitHub Releases as of 25th of December 2021:
image

More information about this can be viewed at https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-43890.

@preciousBlessed
Copy link

Thanks so much @manhthang2504, after being discouraged for almost 12 hours of trying and searching I somehow stumbled here and your response useful.
I still have further issues installing oh-my-posh on my win10 pro... I pray I'll be able to find help here.
I'm new to gitHub and I'd really love to grow. I'm on that path now, and I feel this community will play a big role in my development. Thanks so much, thanks everyone.

@denelon denelon added this to the v1.3-Client milestone Jun 21, 2022
@Table-09
Copy link

Table-09 commented Jul 1, 2022

I am still experiencing these problems, it only started happening a few weeks ago i noticed I could not access winget via CMD, but it works via powershell strangely.

Anyone know what this might be caused by? I even tried a windows in-place install and followed the instructions above to no avail :(

@Olindholm
Copy link

To avoid going round in circles :

  1. Go to the application path %userprofile%\AppData\Local\Microsoft\WindowsApps
  2. If winget.exe exists, go to the next step, otherwise make sure you meet conditions or try to download & install the latest appxbundle
  3. Then go to your Environment Variables (if you can't find it, type it on Windows Search)
    image
  4. Click Edit, Environment Variables, Path, New,
  5. Then enter %userprofile%\AppData\Local\Microsoft\WindowsApps\
    image
  6. Click Ok for all dialogs
  7. Open a new command line window (run-as Administrator is best)
  8. Should now work

Great instructions, but didn't help me in the end.
I already had the App Installer installed, and by installing it, I reinstalled it. Still did not help.
Already had the environment variable.

I solved this issue another way.

  1. Open "Settings > Apps > Apps & features*
  2. Click "App execution aliases"
  3. Find "Windows Package Manager Client", and make sure it's on.
    image

Hope this helps someone else in future!, I was about to go mad!

@Brynyard
Copy link

Is there a way to access winget without going through the WindowsApps hack (0 size files that cmd has some internal magic to resolve to it's real path)?

@MarkIngramUK
Copy link

Is there a way to access winget without going through the WindowsApps hack (0 size files that cmd has some internal magic to resolve to it's real path)?

It's not internal to cmd, it's a general feature called "App Execution Aliases". You can manage them in Settings:
image

@Brynyard
Copy link

Brynyard commented Jul 10, 2023 via email

@DMZTdhruv
Copy link

Juat update the app installer from Microsoft store and winget will work 😊

@stanoychev
Copy link

quality work 👌

@sophiehongcai
Copy link

To avoid going round in circles :

  1. Go to the application path %userprofile%\AppData\Local\Microsoft\WindowsApps
  2. If winget.exe exists, go to the next step, otherwise make sure you meet conditions or try to download & install the latest appxbundle
  3. Then go to your Environment Variables (if you can't find it, type it on Windows Search)
    image
  4. Click Edit, Environment Variables, Path, New,
  5. Then enter %userprofile%\AppData\Local\Microsoft\WindowsApps\
    image
  6. Click Ok for all dialogs
  7. Open a new command line window (run-as Administrator is best)
  8. Should now work

Thank you for saving my couple of hours searching the solution~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests