Critical error on Windows 11 after updating to 0.3.0 (wmic process command fails)
What happened?
After updating gemini-cli to 0.3.0 on Windows 11, the application crashes with the following error when starting a second time:
An unexpected critical error occurred:
Error: Command failed: wmic process where "ProcessId=47792" get Name,ParentProcessId,CommandLine /value
ERROR:
Description = The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at ChildProcess.exithandler (node:child_process:414:12)
at ChildProcess.emit (node:events:518:28)
at maybeClose (node:internal/child_process:1101:16)
at ChildProcess._handle.onexit (node:internal/child_process:304:5)
If I downgrade back to 0.22.0, the problem disappears completely.
What did you expect to happen?
I expected gemini-cli to run normally on Windows 11 after the update without throwing a wmic error.
Client information
Login information
Logging in with Google Account.
Anything else we need to know?
It seems the error is related to the use of wmic, which is deprecated/disabled by default on some versions of Windows 11. This might explain why the process command fails in 0.3.0 but not in 0.22.0:
This is a critical bug on Windows 11 caused by the use of a deprecated wmic command, preventing the application from starting. This makes it an area/platform bug with priority/p1.
Same issue here
@skeshive, please backport #7087 to v3. You cannot wait v4 for this, Gemini CLI will be unusable for Windows users. This is not a feature, it's a critical bug.
Yes can confirm this version is completely unusable on windows
Getting same error, updated gemini-cli just now to v0.3.0.
An unexpected critical error occurred: Error: Command failed: wmic process where "ProcessId=14780" get Name,ParentProcessId,CommandLine /value 'wmic' is not recognized as an internal or external command, operable program or batch file.
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at ChildProcess.exithandler (node:child_process:417:12)
at ChildProcess.emit (node:events:518:28)
at maybeClose (node:internal/child_process:1101:16)
at ChildProcess._handle.onexit (node:internal/child_process:304:5)
just when i thought this issue happens on my device only, didnt know its a global issue now
How do you release an update without even a little testing?
i just tested the nightly build and it seems to work fine for now as a temp solution(it worked for me at least)
npm install -g @google/gemini-cli@nightly
Oh my god. You introduce a PR with a bug, and then the bug is fixed in main with another PR. Then you release a stable version without a second PR, and then you are making a hotfix for a bug, that is already in main branch.
#7076
@skeshive what are you doing?
In the nightly version, when launching gemini-cli through PowerShell, the following error now occurs:
[WARN] Skipping unreadable directory: C:\WINDOWS\system32\WebThreatDefSvc (EPERM: operation not permitted, scandir 'C:\WINDOWS\system32\WebThreatDefSvc')
An unexpected critical error occurred:
Error: Command failed: powershell "$p = Get-CimInstance Win32_Process -Filter 'ProcessId=49000' -ErrorAction SilentlyContinue; if ($p) { @{Name=$p.Name;ParentProcessId=$p.ParentProcessId;CommandLine=$p.CommandLine} | ConvertTo-Json }"
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at ChildProcess.exithandler (node:child_process:414:12)
at ChildProcess.emit (node:events:518:28)
at maybeClose (node:internal/child_process:1101:16)
at ChildProcess._handle.onexit (node:internal/child_process:304:5)
⠹ Connecting to MCP servers... (0/2)
When running it through CMD, the program just enters an endless loading state.
Stable version 0.3.2 fixed this
npm install -g @google/gemini-cli