top | item 46910513

(no title)

cheriot | 25 days ago

Page me when codex can run the right version of node. Are we all changing the system node version to match the current project again?

[shell_environment_policy]

inherit = "all"

experimental_use_profile = true

[shell_environment_policy.set]

NVM_DIR = "[redacted]"

PATH = "[redacted]"

discuss

order

maxkfranz|24 days ago

It worked for me after I configured mise. I needed the mise setup in both `.zprofile` and `.zshrc` for Codex to pick it up. I think mise sets up itself in one of those by default, but Codex uses the other. I expect the same problem would present itself with nvm.

I.e. `eval "$(/Users/max/.local/bin/mise activate zsh)"` in `.zprofile` and `.zshrc`

Then Codex will respect whatever node you've set as default, e.g.:

    mise install node@24
    mise use -g node@24
Codex might respect your project-local `.nvmrc` or `mise.toml` with this setup, but I'm not certain. I was just happy to get Codex to not use a version of node installed by brew (as a dependency of some other package).

cheriot|24 days ago

Thanks! I moved my PATH setup to .zprofile and everything works now. Brew had added itself to .zprofile and everything else was in .zshrc.

Sn0wCoder|24 days ago

If you are already using Volta in your project Codex will use the correct version assuming you are running in the same directory as your .json file and the json file has the” volta”:{ “node”: “xx.x.x”, “npm”: “xx.x.x”} configured. Personally use a Dockerfile to setup the container with volta installed. Need to set up Volta and configure at least one version of Node then install Codex in the docker. One caveat is you need to update codex with the initial version of node assuming it’s not the same as your project. If you are using one image per project you should never run into this but I have been using one image and firing up a container for each project, so it was great to see Codex able to use the correct version configured for the project via Volta.

From other comments sounds like Codex using mise for internal tools can cause issues but not sure that is 100% Codex fault if the project is not already defining the node/npm version in the json “engines” entry. If it’s ignoring that entry then I guess this is a valid complaint, but not sure how Codex is supposed to guess which version of tools to use for different projects.

Would you mind adding more details as to the exact setup where Codex is using the wrong version?

cheriot|24 days ago

Codex is using a login shell so moving my PATH setup to .zprofile fixed it (previously was in .zshrc). Now we just need to write this on the internet enough times that future codex can suggest the fix :p

smarx007|25 days ago

Both Claude and Gemini (the web variants, not CLI) tried to downgrade my .NET 10 projects to .NET 9 at least a few times.