Error: ENOENT: no such file or directory, open "Error: ENOENT: no such file or directory, open 'C:\Users\willm\AppData\Local\Temp\oai-codex\codex-cli-2025-05-09T15:47:02.log'

Resolved 💬 5 comments Opened May 9, 2025 by will380 Closed Aug 7, 2025

What version of Codex is running?

0.1.2504301751

Which model were you using?

04-mini

What platform is your computer?

Windows

What steps can reproduce the bug?

PS C:\Users\willm\Desktop\uig\github-qhjgu8pk-yvwfd145> codex
Error: ENOENT: no such file or directory, open 'C:\Users\willm\AppData\Local\Temp\oai-codex\codex-cli-2025-05-09T15:47:02.log'
at Module.writeFileSync (node:fs:2426:20)
at pT (file:///C:/Users/willm/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:163:3080)
at file:///C:/Users/willm/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:719:752 {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\\Users\\willm\\AppData\\Local\\Temp\\oai-codex\\codex-cli-2025-05-09T15:47:02.log'
}

What is the expected behavior?

_No response_

What do you see instead?

_No response_

Additional information

_No response_

View original on GitHub ↗

5 Comments

will380 · 1 year ago

tried to reinstall node several times, to reinstall codex several times as well. Nothing worked, it doesn't seem to be able to create the log file that it needs.

amerizalde · 1 year ago

this will install to windows just fine, but is not meant to be used in Windows directly. try installing to a WSL linux distro, it will know how to work properly.

SphaeroX · 1 year ago

same here

C:\Users\xxx>codex
Error: ENOENT: no such file or directory, open 'C:\Users\xxx\AppData\Local\Temp\oai-codex\codex-cli-2025-06-18T08:59:34.log'
    at Module.writeFileSync (node:fs:2426:20)
    at vD (file:///C:/Users/xxx/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:163:3080)
    at file:///C:/Users/xxx/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:1018:46 {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Users\\xxx\\AppData\\Local\\Temp\\oai-codex\\codex-cli-2025-06-18T08:59:34.log'
}

The root cause of the error is Windows, since colons are forbidden in file names on Windows systems. This should be corrected accordingly. I have checked — the folder does exist, but there are no files inside it. So, as mentioned, it probably cannot create the file at all.

codex-maintainers · 1 year ago

Thank you for the feedback! Please try using the latest version of Codex CLI to see if the issue persists. We're focusing on the native/Rust implementation of Codex CLI. If the issue continues, feel free to report it there.

SphaeroX · 1 year ago

Still there...

C:\Users\xx>codex
Error: ENOENT: no such file or directory, open 'C:\Users\xx\AppData\Local\Temp\oai-codex\codex-cli-2025-08-08T09:53:42.log'
    at Module.writeFileSync (node:fs:2426:20)
    at _D (file:///C:/Users/xx/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:163:3080)
    at file:///C:/Users/xx/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:1022:46 {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Users\\xx\\AppData\\Local\\Temp\\oai-codex\\codex-cli-2025-08-08T09:53:42.log'
}

C:\Users\xx>npm list -g @openai/codex --depth=0
C:\Users\xx\AppData\Roaming\npm
`-- @openai/codex@0.19.0

@will380 can u reopen?