codex can't be run in amazon linux 2 with npm 16

Resolved 💬 3 comments Opened May 22, 2025 by shenxiaoxu Closed Aug 12, 2025

What version of Codex is running?

_No response_

Which model were you using?

gpt-4.1

What platform is your computer?

amazon linux 2

What steps can reproduce the bug?

codex
SyntaxError: Unexpected token 'with'
at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:119:18)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:468:14)
at async link (node:internal/modules/esm/module_job:67:21)

amazon linux 2.

after install codex in npm mode,

codex complains about above error.

% node -v
npm -v

v16.20.2
8.19.4

What is the expected behavior?

_No response_

What do you see instead?

_No response_

Additional information

_No response_

View original on GitHub ↗

2 Comments

211211 · 1 year ago

Upgrade your node to 22 can fix it, it required that ver. on my end.

mwmw7 · 1 year ago
Upgrade your node to 22 can fix it, it required that ver. on my end.

Thank you. After upgrading Node.js, the error message is gone

Showing cached comments. Read the full discussion on GitHub ↗