Verdict
All five install and start on Windows 11 with npm 11, in cmd, on Node 24 and Node 26. Two things trip people up. On a default Windows PowerShell setup all five fail with "running scripts is disabled on this system". And with npm 12, Claude Code and OpenCode install with no error but then refuse to start: "not compatible with the version of Windows you're running".
Tested on
- Agents
- Claude Code 2.1.296, Codex CLI 0.162.1, Gemini CLI 0.63.0, Copilot CLI 1.0.95, OpenCode 1.19.0
- npm
- 11.19.0 / 12.2.0
- Node
- 24.21.0 / 26.11.1
- Re-run
- November 3: Claude Code 2.1.317, Codex 0.166.0, Gemini CLI 0.66.0, Copilot CLI 1.0.105, OpenCode 1.19.5; npm 11.19.1 / 12.2.1, Node 24.22.2 / 26.13.0
- OS
- Windows 11 Pro; Windows Server 2025 (GitHub Actions)
✓ Last re-run on GitHub Actions · see the run · all repros
Contents
Every AI coding agent now has a one-line install, and most of the guides for them are written on a Mac. I installed the five most searched ones on a Windows 11 machine with npm install -g, each into a clean, separate folder, and then started each one in cmd and in PowerShell. I tried two npm versions (11, which ships with Node, and 12, the current latest) and two Node versions (24 and 26).
| Agent | npm package | npm 11 | npm 12 | Node 26 | Starts with no account? |
|---|---|---|---|---|---|
| Claude Code 2.1.296 | @anthropic-ai/claude-code |
✅ | ❌ won’t start | ✅ | No: Not logged in · Please run /login |
| Codex CLI 0.162.1 | @openai/codex |
✅ | ✅ | ✅ | No, sign-in needed |
| Gemini CLI 0.63.0 | @google/gemini-cli |
✅ | ✅ (2 scripts blocked) | ✅ | No: asks for an auth method |
| Copilot CLI 1.0.95 | @github/copilot |
✅ | ✅ | ✅ | No: No authentication information found |
| OpenCode 1.19.0 | opencode-ai |
✅ | ❌ won’t start | ✅ | Yes, with its free default model |
“✅” means the install finished and the agent ran. Every install, including the two that broke, ended with added N packages and exit code 0.
1. PowerShell: “running scripts is disabled on this system”
npm installs three launchers for each command: codex (for Git Bash), codex.cmd (for cmd) and codex.ps1 (for PowerShell). PowerShell picks the .ps1, and Windows’ default policy for running scripts on a desktop machine is Restricted. With that policy, all five agents failed the same way:
codex : File C:\Users\you\AppData\Roaming\npm\codex.ps1 cannot be loaded because running scripts is disabled on this
system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
The same commands worked in cmd, which is why you’ll see “works in cmd, not in PowerShell” in so many issue threads. Check your setting with Get-ExecutionPolicy -List. If every line says Undefined, you have the default, and this error.
Allow local scripts for your own account (no admin needed):
Set-ExecutionPolicy -Scope CurrentUser RemoteSignedIf you can’t change the policy (a locked-down work laptop), call the .cmd launcher by name, which PowerShell runs without the policy check:
codex.cmd --version2. npm 12: Claude Code and OpenCode install, then won’t start
npm 12 blocks packages’ install scripts by default (what else that breaks). Claude Code and OpenCode both use a script to put the real Windows program in place. With the script blocked, the install still reports success, and the first run fails:
This version of C:\Users\you\AppData\Roaming\npm\node_modules\opencode-ai\bin\opencode.exe is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher.
Claude Code gives the identical message for claude.exe. Windows makes it sound like a 32/64-bit problem. It isn’t: the .exe npm put there is a placeholder (479 bytes for OpenCode, 500 for Claude Code) that the blocked script was supposed to replace with the real program.
Allow that one package’s script when you install it globally:
npm install -g opencode-ai --allow-scripts=opencode-aiFor Claude Code it’s the same idea with --allow-scripts=@anthropic-ai/claude-code. It’s covered on its own, with every other fix I tried, in claude.exe is not compatible with the version of Windows.
Codex and Copilot have no install script, so npm 12 changes nothing for them. Gemini CLI had two scripts blocked (@github/keytar, which stores credentials, and node-pty, which runs shell commands), and it still started and printed its version. I couldn’t test signed-in use without an account, so if Gemini CLI misbehaves after an npm 12 install, those two are the first suspects.
3. The first run: what each one asks for
I ran each agent once with a prompt (claude -p hi, codex exec hi and so on), with no API keys set and an empty home folder, which is what a brand-new install sees.
-
Claude Code:
Not logged in · Please run /login. Git is no longer required: Git wasn’t on the PATH, and Claude Code went straight to the login check. Its own error text says it now falls back to PowerShell when Git Bash is missing, and only stops if neither is available. -
Codex CLI: in a folder that isn’t a git repository it stops before anything else:
Not inside a trusted directory and --skip-git-repo-check was not specified.That’s a safety check, not an install problem (the fix is below this list).
-
Gemini CLI:
Please set an Auth method in your C:\Users\you\.gemini\settings.json or specify one of the following environment variables before running: GEMINI_API_KEY, GOOGLE_GENAI_USE_VERTEXAI, GOOGLE_GENAI_USE_GCA, with exit code 41. -
Copilot CLI:
No authentication information found.Its first run on a new Windows account also unpacks itself:Package extraction took 31598ms, 181 MB intoAppData\Local\copilot. It looks frozen for half a minute. It isn’t. -
OpenCode: answered the prompt with no account at all, using its free default model.
For Codex, run it inside your project’s git repository. In a folder that isn’t one, add the flag the message names:
codex exec --skip-git-repo-check "say hi"One more Codex detail: run from a script, it also prints Reading additional input from stdin... and waits for input. More on that: Codex: stdin is not a terminal.
Node 24 or Node 26?
Both work. All five printed their versions on Node 24.21.0 and on Node 26.11.1, installed once and run on both. Claude Code and OpenCode are native Windows programs, so Node is only used to install them. Codex, Gemini CLI and Copilot start through Node. If you’re about to upgrade Node anyway, the rest of that upgrade is in Node 26 vs Node 24, tested.
winget instead of npm?
winget search lists four of the five, from their publishers. Gemini CLI isn’t there. On the day I tested, the winget versions were behind npm for three of the four:
| Agent | winget ID | winget version | npm version |
|---|---|---|---|
| Claude Code | Anthropic.ClaudeCode |
2.1.292 | 2.1.296 |
| Codex CLI | OpenAI.Codex |
0.161.0 | 0.162.1 |
| Copilot CLI | GitHub.Copilot |
v1.0.95 | 1.0.95 |
| OpenCode | SST.opencode |
1.18.33 | 1.19.0 |
| Gemini CLI | not listed | 0.63.0 |
A few days behind doesn’t matter for most people, and winget doesn’t go through npm, so npm 12’s script blocking can’t affect it. I only searched winget. I didn’t install from it, because that would have replaced the copy of Claude Code I work with.
The test setup, and the November re-run
Windows 11 Pro, Node 24.21.0 and 26.11.1 from the official zips (checksums verified), npm 11.19.0 (bundled with Node 24.21.0) and npm 12.2.0. Each npm version installed all five agents into its own empty global folder, with its own cache, and every run used a PATH containing only that Node, that folder and Windows itself, so nothing already on the machine could help or interfere. PowerShell was tested per process, with the default policy and with the fix applied. First runs used an empty home folder and no API keys. Every message above is the real output, with my test folders replaced by the default locations (C:\Users\you\AppData\Roaming\npm for npm’s global folder, C:\Users\you for the home folder).
On November 3, 2026 I ran the install part again on a clean Windows Server 2025 machine (GitHub Actions windows-latest), each agent in its own npm prefix and a throwaway user profile, with no account. The main table held on the newer versions: on npm 12.2.1, Claude Code 2.1.317 and OpenCode 1.19.5 installed but their .exe was still the placeholder, so both failed with “not compatible with the version of Windows”, while Codex, Gemini CLI and Copilot CLI ran, and Gemini CLI had two install scripts blocked (@github/keytar and node-pty). All five ran on npm 11.19.1 and on Node 26.13.0. Under a Restricted execution policy, codex.ps1 failed with “running scripts is disabled on this system”, and the .cmd shim still ran. The first-run checks were non-interactive this time, so only two answers are comparable: Claude Code still said Not logged in · Please run /login, and Gemini CLI still asked for an auth method. The winget versions weren’t re-checked. The script and the run are public.
— N.K., end of entry No.058