SyntaxError: Unexpected token `with`
Resolved 💬 3 comments Opened May 17, 2025 by CetinSert Closed May 17, 2025
What version of Codex is running?
0.1.2505161243
Which model were you using?
o3
What platform is your computer?
Linux 5.15.167.4-microsoft-standard-WSL2 x86_64 x86_64
What steps can reproduce the bug?
cetin@Win11:~/rt$ bun install -g @openai/codex
bun add v1.2.13 (64ed68c9)
installed @openai/codex@0.1.2505161243 with binaries:
- codex
1 package installed [130.00ms]
cetin@Win11:~/rt$ codex
SyntaxError: Unexpected token 'with'
at DefaultModuleLoader.moduleStrategy (node:internal/modules/esm/translators:116:18)
at DefaultModuleLoader.moduleProvider (node:internal/modules/esm/loader:190:14)
at async link (node:internal/modules/esm/module_job:67:21)
What is the expected behavior?
codex runs
What do you see instead?
SyntaxError: Unexpected token 'with'
at DefaultModuleLoader.moduleStrategy (node:internal/modules/esm/translators:116:18)
at DefaultModuleLoader.moduleProvider (node:internal/modules/esm/loader:190:14)
at async link (node:internal/modules/esm/module_job:67:21)
Additional information
_No response_
3 Comments
This was a non-issue! I had
nodeandbunin the same environment. Removingnodemakes things work like a charm withbun!I am getting this issue after upgrading codex cli today:
how to solve that?
Problem solved after upgrading node from v20 to v22: