NODE_OPTIONS=--no-deprecation: not found

Resolved 💬 8 comments Opened Apr 16, 2025 by okey00 Closed Apr 16, 2025
💡 Likely answer: A maintainer (jonchurch, contributor) responded on this thread — see the highlighted reply below.

Running via WSL2 on Windows 11 and receiving the following error...

codex: 15: exec: NODE_OPTIONS=--no-deprecation: not found

View original on GitHub ↗

8 Comments

mfrancis107 · 1 year ago

Mac also

LucasArmand · 1 year ago
  1. cd to /mnt/c/Users/yourname/AppData/Roaming/npm
  2. open the codex file with editor of your choice (i.e. vim, nano)
  3. Find this line (around line 15):

exec NODE_OPTIONS=--no-deprecation node ...

  1. Replace it with two lines instead:
export NODE_OPTIONS=--no-deprecation
exec node ...

... is the rest of the code after the --no-deprecation flag in the original line

jonchurch contributor · 1 year ago

This ultimately is coming from the shebang here https://github.com/openai/codex/blob/e9f84eab012bf5d59a02bc79e4d6fb1d44572718/codex-cli/src/cli.tsx#L1

looks like a portability issue? I dont see the error on mac os 15.3.2

okey00 · 1 year ago

Thanks Lucas for the quick response. That worked

jonchurch contributor · 1 year ago

@okey00 That's a workaround, not a fix. You should keep this issue open until root cause is determined and a fix merged

dahifi · 1 year ago

I did a patch in my bin folder so that I wouldn't have to edit the npm package. I've put in a PR that might fix this, hopefully. https://github.com/openai/codex/issues/42

okey00 · 1 year ago

Reopened as suggested by Jon as it's a workaround in it's current state.

tibo-openai collaborator · 1 year ago