microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.14k stars 1.44k forks source link

winget stops working/"'winget' is not recognized as an internal or external command, operable program or batch file." #3507

Open emoxam opened 1 year ago

emoxam commented 1 year ago

Brief description of your issue

A few days ago winget stoped to work.

Steps to reproduce

open cmd and run winget

Expected behavior

winget is working

Actual behavior

"'winget' is not recognized as an internal or external command, operable program or batch file."

Environment

windows 11 22h2 22621.1992
emoxam commented 1 year ago

I've got a file but it's a null size. dir C:\Users\emoxam\AppData\Local\Microsoft\WindowsApps\winget.exe | findstr winget 21.07.2023 12:01 0 winget.exe

But i don't find it useful.

denelon commented 1 year ago

@emoxam which version of "App Installer" is installed?

emoxam commented 1 year ago

@emoxam which version of "App Installer" is installed?

considering MS store it's 1.20.1881.0 installed

emoxam commented 1 year ago

So ?

voltagex commented 1 year ago

I've got a file but it's a null size. dir C:\Users\emoxam\AppData\Local\Microsoft\WindowsApps\winget.exe | findstr winget 21.07.2023 12:01 0 winget.exe

But i don't find it useful.

Try running that file directly in PowerShell:

& "$env:LOCALAPPDATA\Microsoft\WindowsApps\winget.exe"
Windows Package Manager (Preview) v1.7.2722-preview
Copyright (c) Microsoft Corporation. All rights reserved.

The winget command line utility enables installing applications and other packages from the command line.

usage: winget  [<command>] [<options>]

The following commands are available:
  install    Installs the given package
  show       Shows information about a package
  source     Manage sources of packages
  search     Find and show basic info of packages
  list       Display installed packages
  upgrade    Shows and performs available upgrades
  uninstall  Uninstalls the given package
  hash       Helper to hash installer files
  validate   Validates a manifest file
  settings   Open settings or set administrator settings
  features   Shows the status of experimental features
  export     Exports a list of the installed packages
  import     Installs all the packages in a file
  pin        Manage package pins
  configure  Configures the system into a desired state
  download   Downloads the installer from a given package

For more details on a specific command, pass it the help argument. [-?]

The following options are available:
  -v,--version              Display the version of the tool
  --info                    Display general info of the tool
  -?,--help                 Shows help about the selected command
  --wait                    Prompts the user to press any key before exiting
  --logs,--open-logs        Open the default logs location
  --verbose,--verbose-logs  Enables verbose logging for winget
  --disable-interactivity   Disable interactive prompts

More help can be found at: https://aka.ms/winget-command-help

i.e. something is wrong with the PATH environment variable