relax node 22 or newer requirement

Resolved 💬 6 comments Opened Apr 17, 2025 by timdinh Closed Aug 7, 2025
💡 Likely answer: A maintainer (tibo-openai, collaborator) responded on this thread — see the highlighted reply below.

This is a nice tool, however, it required node 22 or newer.

We have projects on older node version and we use nvm to switch version depending on the project we are working on. If we switch to node 22 then our project can't be run or build, if we switch to version 19 then it can't find codex (since it installed with node v22).

I'm sure there are many existing projects that are still on node older than 22 that can't be upgrade yet. Is it possible to create this tool in native binary for macOS and windows so that it doesn't depend on node?

Maybe use codex to do conversion?

View original on GitHub ↗

6 Comments

tibo-openai collaborator · 1 year ago

Could you use something like

bash codex () { nvm exec 22 "$(npm -g bin)/codex" "$@"; } && export -f codex

?

Or alternatively look into packaging it into a binary, e.g. using pkg.

jstjoe · 1 year ago

+1 to bundling the required node version with the CLI. I'm not sure if pkg is the best approach but when working in projects on older versions of node the dependency conflict is a hurdle. Thanks for the workaround @tibo-openai

edited to add: my doubts about pkg are just because it hasn't been updated in 2 years and I haven't used it or worked on a project with it personally.

jstjoe · 1 year ago

Okay I got curious so I looked into it and the original pkg was deprecated by Vercel last year. This seems to be the most actively-maintained fork with a new patch release 4 days ago: https://github.com/yao-pkg/pkg

Docker is also an option for this.

tqwhite · 1 year ago

I SOLVED IT!! I'm using Claude.

0xdevalias · 1 year ago

The actual solution is that they are moving codex to a rust based CLI; which can be installed already; but it's not yet at feature parity.

I think it may have been announced in the discussions page or similar; but I don't currently have the link on hand.

codex-maintainers · 1 year ago

Thank you for the feedback! We're working on a Rust implementation of Codex CLI that addresses the Node.js dependency issue. Please try the latest version of Codex CLI by following the instructions here. Let us know if you encounter any issues!