Shell commands are failing on Windows 11.
What happened?
│ x Shell Command ls │
│ │
│ The @lydell/node-pty package supports your platform (win32-x64), but it could not find the binary package for │
│ it: @lydell/node-pty-win32-x64/conpty.node │
│ │
│ This can happen if you use the "--omit=optional" (or "--no-optional") npm flag. │
│ The "optionalDependencies" package.json feature is used to install the correct │
│ binary executable for your current platform. Remove that flag to use @lydell/node-pty. │
│ │
│ This can also happen if the "node_modules" folder was copied between two operating systems │
│ that need different binaries - including "virtual" operating systems like Docker and WSL. │
│ If so, try installing with npm rather than copying "node_modules". │
│ (Command produced no output)
What did you expect to happen?
!ls
For example should work.
Client information
Client Information
Run gemini to enter the interactive CLI, then run the /about command.
> /about
│ About Gemini CLI │
│ │
│ CLI Version 0.9.0 │
│ Git Commit a93d92a3 │
│ Model gemini-2.5-pro │
│ Sandbox no sandbox │
│ OS win32 │
│ Auth Method gemini-api-key │
│ │
Login information
No response
Anything else we need to know?
No response
Fix it with (it worked for me):
npm i @lydell/node-pty-win32-x64
Somehow seems is missing on gemini instalation on windows that of course severely restricts the tool to execute commands like builds etc.
Turn off the interactive shell so Gemini uses the fallback executor:
Create or edit ~.gemini\settings.json on Windows:
{
"tools": {
"shell": {
"enableInteractiveShell": false
}
}
}
add this and it fixed it for me. Hope this helps.
Hi @SkybuckFlying , Thanks for reporting this issue. To help us understand what's going on, could you please provide a few more details?
-
What is your Node.js version (you can find this by running node -v)?
-
How did you install the Gemini CLI (e.g., npm i -g @google/gemini-cli)?
-
Did you have auto-update enabled for Gemini CLI?
-
Do you run into the same issue if you try executing it directly with
npx https://github.com/google-gemini/gemini-cli? -
Did you see any other errors? If so, could you please paste the full error message or a screenshot?
Thanks in advance!
Q1 answer:
Microsoft Windows [Version 10.0.22631.5768]
(c) Microsoft Corporation. All rights reserved.
C:\Users\skybu>node -v
v22.12.0
C:\Users\skybu>
Q2 answer: Usually: npm install -g @google/gemini-cli
Q3 answer: No
Q4 answer: I don't use npx.
Q5 answer: No other errors I can remember.
I don't understand what these gemini settings have to do with it, maybe the gemini settings were updated in newer versions of gemini cli and my system uses an old version of gemini cli settings. Here is one gemini cli settings file:
settings.json:
{
"ide": {
"hasSeenNudge": true
},
"general": {
"disableAutoUpdate": true,
"previewFeatures": true
},
"security": {
"auth": {
"selectedType": "gemini-api-key"
}
},
"ui": {
"theme": "Default",
"showMemoryUsage": false,
"showLineNumbers": false
},
"context": {
"loadMemoryFromIncludeDirectories": true,
"loadFromIncludeDirectories": true
}
}
I have removed these two lines from file: .npmrc
gyp_rebuild=true os=linux
Maybe this "os spoofing" is confusing the installation of gemini-cli and it doesn't understand it's on windows ?
So now that it's gone, next time I will pay attention to this to see if this issue returns.
This should also clean up the warning about:
npm warn Unknown user config "gyp_rebuild". This will stop working in the next major version of npm.
I can't remember why this was added to this file. I could have been done by me, maybe by miss-direction by AI.
It may have been done by other software.
It may have been done during some linux session perhaps in wsl2...
Can't remember... but for now AI has advised to remove these two lines so I will try that for now :)
My hunch is it may have had something to do with building firefox, not sure...
I consulted AI and it's coming back to me, it does seem Firefox build related for that reason I have documented it as follows and disabled it via comments:
5 december 2025 by Skybuck Flying
To build firefox successfully it might be necessary to change this file: C:\Users\skybu.npmrc
; Probably necessary to build Firefox on Windows 11: ; Disabled for now because it might cause gemini-cli installation failure, platform dependent packages does not get installed. ; gyp_rebuild=true
; Perhaps leave this turned off when trying to build Firefox on Windows 11, if build fails, try turning this on again by removing the ; ; os=linux
To detect if these changes are in effect:
npm config list
Example of output when it's in effect:
G:\Tools\npm-global\node_modules\@google\gemini-cli>npm config list
npm warn Unknown user config "gyp_rebuild". This will stop working in the next major version of npm.
; "user" config from C:\Users\skybu\.npmrc
gyp_rebuild = true
os = "linux"
; "env" config from environment
cache = "G:\\tools\\npm-cache"
prefix = "G:\\Tools\\npm-global"
; node bin location = G:\Tools\nvmnodejs\node.exe
; node version = v22.12.0
; npm local prefix = G:\Tools\npm-global\node_modules\@google\gemini-cli
; npm version = 11.6.4
; cwd = G:\Tools\npm-global\node_modules\@google\gemini-cli
; HOME = C:\Users\skybu
; Run `npm config ls -l` to show all defaults.
Unfortunately now it's leading to a crash:
⠦ Creating Base for Rebasing (esc to cancel, 11s)
Using: 1 GEMINI.md file YOLO mode (ctrl + y to toggle) ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ * Type your message or @path/to/file │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ V:\JulesSkyVite (1a616095a*) no sandbox (see /docs) flash | ✖ 1 error (F12 for details) G:\Tools\npm-global\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windowsPtyAgent.js:93 throw new Error('Cannot resize a pty that has already exited'); ^
Error: Cannot resize a pty that has already exited
at WindowsPtyAgent.resize (G:\Tools\npm-global\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windowsPtyAgent.js:93:19)
at WindowsTerminal.
Node.js v22.12.0
V:\JulesSkyVite>
Hmmm...
It does seem related to this binary package...
Un-installing and Re-installing gemini-cli to see if that helps:
V:\JulesSkyVite>where gemini G:\Tools\npm-global\gemini G:\Tools\npm-global\gemini.cmd
V:\JulesSkyVite>npm uninstall -g @google/gemini-cli
removed 668 packages in 10s
V:\JulesSkyVite>npm cache clean --force npm warn using --force Recommended protections disabled.
V:\JulesSkyVite>npm install -g @google/gemini-cli npm warn deprecated [email protected]: Use your platform's native DOMException instead
added 577 packages in 2m
153 packages are looking for funding
run npm fund for details
V:\JulesSkyVite>gemini --version
(node:10840) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
0.19.1
V:\JulesSkyVite>
Nope it still crashes:
> /model
> Take a look at the following git log.It's a mess. Jules.google.com bot made a mess out of things.I want you to clean up this mess.I want
you to make a new branch based of this commit point:Branch/Develop/Delphi Also known as commit hash: 1a616095aThen I want you to take all
commits from commit hash 42a7ffd64 to commit hash 20cf20291 and replay all of these commits, so that each commit has it's own translation
branch as follows:Branch/Develop/Delphi/Translate/JulesGoogleCom/Task/0001/Session/0001/Contribution/0001Where each commit has it's own
contribution number, starting from 1 and then incrementally increasing per commit.I also want you to examine the changes to the code to
see if they are any good.I also want you to produce a new file if it does not yet exist called: GoToDelphiMappingConverted.txt.In this
list the files that were converted by these commits should be recorded as they appeared in GoToDelphiMappingMissing.txt.Also if
files/units were merged into one this should be recorded in GoToDelphiMappingConverted.txt as follows:<file
number>:"<somefile.go>","ledger\chain\Ledger.Chain.Onroad.Test.pas" merged into
"<subfolders>\Somefile.pas"Example:248:"ledger\chain\onroad_test.go","ledger\chain\Ledger.Chain.Onroad.Test.pas" merged into
"ledger\chain\Whatever.pas"I also want you to make a good git commit message, describing which files were converted. So there should be at
least 1 entry/line of text per file converted.Some further rules to follow:1. Do not re-merge the Branch/Develop/Delphi back into
anything.2. Each commit should cleanly show what files where changed and should not contain changes from previous commits.* 1a616095a
(HEAD -> Branch/Develop/Delphi, origin/Branch/Develop/Delphi) SystemPrompt updated with git flow instructions.| * 20cf20291
(Jules/Branch/Develop/Delphi) Merge pull request #6 from SkybuckFlying/feat/delphi-conversion-batch-4| |
| | * 066c64388 (Jules/feat/delphi-conversion-batch-4) Merge branch 'Branch/Develop/Delphi' into feat/delphi-conversion-batch-4| | |
| | |/| |/|| * | cd8ffc7c4 Merge pull request #5 from SkybuckFlying/feat/delphi-conversion-batch-3| |\
| | * \ 025780be3 (Jules/feat/delphi-conversion-batch-3) Merge branch 'Branch/Develop/Delphi' into feat/delphi-conversion-batch-3| | |\
| | |/ /| |/| || * | | 092afb8fc (OldBranch/Develop/Delphi) Merge pull request #4 from SkybuckFlying/feat/convert-ledger-and-test-units|
|\ \
| | * \ \ b6bfe4f40 (Jules/feat/convert-ledger-and-test-units) Merge branch 'Branch/Develop/Delphi' into
feat/convert-ledger-and-test-units| | |\ \
| | |/ / /| |/| | || * | | | 7f368d0d9 Merge pull request #3 from SkybuckFlying/feat/convert-xleveldb-and-tests-batch-2| |\ \ \
| | * \ \ \ ceeaa3425 (Jules/feat/convert-xleveldb-and-tests-batch-2) Merge branch 'Branch/Develop/Delphi' into
feat/convert-xleveldb-and-tests-batch-2| | |\ \ \
| | |/ / / /| |/| | | || * | | | | dae5e652f Merge pull request #2 from SkybuckFlying/feat/convert-xleveldb-and-helper-tests| |\ \ \ \
| | * \ \ \ \ f52932f35 (Jules/feat/convert-xleveldb-and-helper-tests) Merge branch 'Branch/Develop/Delphi' into
feat/convert-xleveldb-and-helper-tests| | |\ \ \ \
| | |/ / / / /| |/| | | | || * | | | | | 694235bba Merge pull request #1 from SkybuckFlying/feat/convert-dex-client-and-flock-utils|/| | |
| | || | * | | | | 95704f99f feat: Convert xleveldb and helper test units to Delphi| |/ / / / /|/| | | | || | * | | | b117ccd73 feat:
Convert xleveldb and test units to Delphi| |/ / / /|/| | | || | * | | 89e027f86 feat: Convert ledger, block, and test units to Delphi| |/
/ /|/| | || | * | bfa611796 feat: Convert next batch of Go files to Delphi| |/ /|/| || | * c85d9ddbe feat: Convert next batch of Go files
to Delphi| |/|/|| | * 43fc90698 (Jules/feat/convert-dex-client-and-flock-utils) fix: Correct bugs and continue Go to Delphi conversion|
|/| * 42a7ffd64 feat: Convert dex client and flock utilities to Delphi|/* 5ec9a7aad SystemPrompt.md modifications made for FPC and
jules.google.com
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ⊶ Shell git log --no-merges --pretty=format:%H 42a7ffd64..20cf20291 --reverse [current working directory V:\JulesSkyVite] (Get non-mer… │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
⠸ Identifying Rebase Range (esc to cancel, 10s)
Using: 1 GEMINI.md file YOLO mode (ctrl + y to toggle)
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ * Type your message or @path/to/file │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
V:\JulesSkyVite (1a616095a*) no sandbox (see /docs) flash
G:\Tools\npm-global\node_modules\@google\gemini-cli\node_modules\@lydell\node-pty\windowsPtyAgent.js:93
throw new Error('Cannot resize a pty that has already exited');
^
Error: Cannot resize a pty that has already exited
at WindowsPtyAgent.resize (G:\Tools\npm-global\node_modules\@google\gemini-cli\node_modules\@lydell\node-pty\windowsPtyAgent.js:93:19)
at WindowsTerminal.<anonymous> (G:\Tools\npm-global\node_modules\@google\gemini-cli\node_modules\@lydell\node-pty\windowsTerminal.js:131:26)
at Object.run (G:\Tools\npm-global\node_modules\@google\gemini-cli\node_modules\@lydell\node-pty\windowsTerminal.js:167:50)
at G:\Tools\npm-global\node_modules\@google\gemini-cli\node_modules\@lydell\node-pty\windowsTerminal.js:73:32
at Array.forEach (<anonymous>)
at Socket.<anonymous> (G:\Tools\npm-global\node_modules\@google\gemini-cli\node_modules\@lydell\node-pty\windowsTerminal.js:68:42)
at Socket.emit (node:events:536:35)
at addChunk (node:internal/streams/readable:561:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
at Readable.push (node:internal/streams/readable:392:5)
Node.js v22.12.0
V:\JulesSkyVite>
Going to make seperate issue out of this... to bring it some attention cause it's starting to seem like it's at least preventing me from using this version of gemini-cli the latest...
Same issue here C:\Users\atomi>node -v v23.10.0
It'll cause gemini sometimes to tool loop on failure.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ x Shell {"command":"dir /s /b conversion_tasks\\frontend","description":"Listing the frontend conversion tasks."} │ │ │ │ The @lydell/node-pty package supports your platform (win32-x64), but it could not find the binary package for it: @lydell/node-pty-win32-x64/conpty.node │ │ │ │ This can happen if you use the "--omit=optional" (or "--no-optional") npm flag. │ │ The "optionalDependencies" package.json feature is used to install the correct │ │ binary executable for your current platform. Remove that flag to use @lydell/node-pty. │ │ │ │ This can also happen if the "node_modules" folder was copied between two operating systems │ │ that need different binaries - including "virtual" operating systems like Docker and WSL. │ │ If so, try installing with npm rather than copying "node_modules". │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ✦ The shell command failed again. I'll switch to the list_directory tool to see the frontend task files. ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ ✓ ReadFolder conversion_tasks/frontend │ │ │ │ Listed 27 item(s).
even tried npm install -g @lydell/node-pty
added 2 packages in 1s
notice still persists.
Also having this issue even after a reinstall of the Gemini-cli package. Happy to help provide system outputs for troubleshooting.