codex - 💡(How to fix) Fix Windows npm install can leave Codex silently unable to launch without VC++ runtime [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#20827Fetched 2026-05-03 04:44:48
View on GitHub
Comments
2
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2

Error Message

  1. The installer or launcher should detect the missing Microsoft Visual C++ runtime and print a clear actionable error.

Root Cause

Codex could not start because the Microsoft Visual C++ runtime is missing.
Install it with:
winget install --id Microsoft.VCRedist.2015+.x64 --exact --source winget

Fix Action

Fix / Workaround

What is the workaround?

Code Example

Microsoft Windows [Version 10.0.26200.8246]

---

node v24.15.0
npm 11.12.1

---

C:\Users\win\AppData\Roaming\npm\codex.ps1
C:\Users\win\AppData\Roaming\npm\node_modules\@openai\codex
C:\Users\win\AppData\Roaming\npm\node_modules\@openai\codex\node_modules\@openai\codex-win32-x64

---

codex --version
# exit=-1073741515

cmd /c codex --version
# exit=-1073741515

C:\Users\win\AppData\Roaming\npm\node_modules\@openai\codex\node_modules\@openai\codex-win32-x64\vendor\x86_64-pc-windows-msvc\codex\codex.exe --version
# exit=-1073741515

---

vcruntime140.dll
vcruntime140_1.dll
msvcp140.dll

---

npm i -g @openai/codex

---

codex

---

winget install --id Microsoft.VCRedist.2015+.x64 --exact --source winget --accept-package-agreements --accept-source-agreements

---

codex --version
# codex-cli 0.128.0
# exit=0

cmd /c codex --version
# codex-cli 0.128.0
# exit=0

C:\Users\win\AppData\Roaming\npm\node_modules\@openai\codex\node_modules\@openai\codex-win32-x64\vendor\x86_64-pc-windows-msvc\codex\codex.exe --version
# codex-cli 0.128.0
# exit=0

---

Microsoft Visual C++ v14 Redistributable (x64) - 14.50.35719

---

Codex could not start because the Microsoft Visual C++ runtime is missing.
Install it with:
winget install --id Microsoft.VCRedist.2015+.x64 --exact --source winget
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

@openai/[email protected] / codex-cli 0.128.0

What subscription do you have?

No response

Which model were you using?

Not reached; the CLI failed before opening normally.

What platform is your computer?

Fresh/latest Windows 11 machine:

Microsoft Windows [Version 10.0.26200.8246]

Node/npm installed first:

node v24.15.0
npm 11.12.1

What issue are you seeing?

On a fresh Windows 11 setup, installing Codex via npm appeared to succeed, but running codex did nothing / failed silently from the user's perspective.

After investigation, the npm install itself was successful. The generated npm shims and Windows x64 Codex package were present:

C:\Users\win\AppData\Roaming\npm\codex.ps1
C:\Users\win\AppData\Roaming\npm\node_modules\@openai\codex
C:\Users\win\AppData\Roaming\npm\node_modules\@openai\codex\node_modules\@openai\codex-win32-x64

The actual launch failure was the native Windows binary exiting immediately with status -1073741515:

codex --version
# exit=-1073741515

cmd /c codex --version
# exit=-1073741515

C:\Users\win\AppData\Roaming\npm\node_modules\@openai\codex\node_modules\@openai\codex-win32-x64\vendor\x86_64-pc-windows-msvc\codex\codex.exe --version
# exit=-1073741515

On Windows, that is 0xC0000135, which indicates a required DLL was missing. The machine did not have the Visual C++ runtime DLLs installed, including:

vcruntime140.dll
vcruntime140_1.dll
msvcp140.dll

It also had no installed Microsoft Visual C++ Redistributable entry.

What steps can reproduce the bug?

On a fresh Windows 11 machine without the Visual C++ Redistributable installed:

  1. Install Node/npm.

  2. Install Codex:

    npm i -g @openai/codex
  3. Run Codex:

    codex
  4. Observe that nothing useful appears to happen from the user's perspective.

  5. Check the binary directly and observe exit code -1073741515 / 0xC0000135.

What is the expected behavior?

One of:

  1. The npm package should include or avoid the missing runtime dependency, if feasible.
  2. The installer or launcher should detect the missing Microsoft Visual C++ runtime and print a clear actionable error.
  3. The Windows installation documentation should explicitly list the Microsoft Visual C++ Redistributable as a prerequisite.

A silent/no-output launch failure makes the npm install look broken even though the missing dependency is outside npm.

What is the workaround?

Installing the Microsoft Visual C++ 2015+ x64 redistributable fixed the issue:

winget install --id Microsoft.VCRedist.2015+.x64 --exact --source winget --accept-package-agreements --accept-source-agreements

After that, the expected runtime DLLs appeared in C:\Windows\System32, and all launch paths succeeded:

codex --version
# codex-cli 0.128.0
# exit=0

cmd /c codex --version
# codex-cli 0.128.0
# exit=0

C:\Users\win\AppData\Roaming\npm\node_modules\@openai\codex\node_modules\@openai\codex-win32-x64\vendor\x86_64-pc-windows-msvc\codex\codex.exe --version
# codex-cli 0.128.0
# exit=0

Installed runtime afterward:

Microsoft Visual C++ v14 Redistributable (x64) - 14.50.35719

Additional information

The npm debug logs showed successful installs of @openai/[email protected] and @openai/[email protected]; this was not an npm package fetch/install failure. The failure was only at native binary launch time.

Suggested product fix: have the Windows launcher catch 0xC0000135 / missing DLL startup failures and print something like:

Codex could not start because the Microsoft Visual C++ runtime is missing.
Install it with:
winget install --id Microsoft.VCRedist.2015+.x64 --exact --source winget

That would turn a confusing silent failure into a one-command fix.

extent analysis

TL;DR

Installing the Microsoft Visual C++ 2015+ x64 redistributable fixes the issue with the Codex CLI failing to launch on a fresh Windows 11 machine.

Guidance

  • The root cause of the issue is the missing Microsoft Visual C++ runtime DLLs, including vcruntime140.dll, vcruntime140_1.dll, and msvcp140.dll.
  • To verify the fix, check that the expected runtime DLLs are present in C:\Windows\System32 after installing the Microsoft Visual C++ Redistributable.
  • To mitigate the issue, install the Microsoft Visual C++ 2015+ x64 redistributable using the suggested command: winget install --id Microsoft.VCRedist.2015+.x64 --exact --source winget --accept-package-agreements --accept-source-agreements.
  • Consider modifying the Windows launcher to catch 0xC0000135 / missing DLL startup failures and print a clear actionable error message.

Example

No code snippet is necessary in this case, as the solution involves installing a system-level dependency.

Notes

This fix assumes that the issue is indeed caused by the missing Microsoft Visual C++ runtime DLLs. If the issue persists after installing the redistributable, further investigation may be necessary.

Recommendation

Apply the workaround by installing the Microsoft Visual C++ 2015+ x64 redistributable, as it is a straightforward and effective solution to the problem.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING