Unable to setup the codex
Resolved 💬 3 comments Opened Apr 28, 2025 by smartcraze Closed Apr 29, 2025
💡 Likely answer: A maintainer (tibo-openai, collaborator)
responded on this thread — see the highlighted reply below.
What is the type of issue?
Documentation is missing
What is the issue?
gives out this error
suraj@suraj ~/p/Second-brain-Backends (main)> codex
Initializing agent…
ERROR crypto is not defined
file:///usr/local/lib/node_modules/@openai/codex/dist/cli.js:556:2000
- (file:///usr/local/lib/node_modules/@openai/codex/dist/cli.js:556:2000)
- V1 (file:///usr/local/lib/node_modules/@openai/codex/dist/cli.js:112:27748)
- f_e (file:///usr/local/lib/node_modules/@openai/codex/dist/cli.js:125:13588)
- p_e (file:///usr/local/lib/node_modules/@openai/codex/dist/cli.js:125:13331)
- d_e (file:///usr/local/lib/node_modules/@openai/codex/dist/cli.js:125:13237)
- u_e (file:///usr/local/lib/node_modules/@openai/codex/dist/cli.js:125:13113)
- lAe (file:///usr/local/lib/node_modules/@openai/codex/dist/cli.js:129:11795)
- ad (file:///usr/local/lib/node_modules/@openai/codex/dist/cli.js:129:11449)
- (file:///usr/local/lib/node_modules/@openai/codex/dist/cli.js:129:10543)
- ye (file:///usr/local/lib/node_modules/@openai/codex/dist/cli.js:26:15388)
Where did you find it?
_No response_
Showing cached comments. Read the full discussion on GitHub ↗
2 Comments
@smartcraze the
crypto is not definederror appears to happen when you are accidentally using a version of Node that's too old.I didn't realize my NVM was set to use Node version ~16 by default, and after installing
codex(which succeeded despite the node version being too old 🤔 ) on that old version I tried thecodexcommand and was greeted withcrypto not defined.After upgrading to the the latest node version a fresh install of
codexseems to work as expected.Should use node version of at least 22.