Skip to content

Bug: Missing optional dependency @openai/codex-win32-x64 on Windows (v0.124) #19243

Open

Description

@asdfqwerzxcc

What version of Codex CLI is running?

0.124.0

What subscription do you have?

pro

Which model were you using?

No response

What platform is your computer?

OS: Windows 10 x64 Node.js: (e.g. v20.12.2) npm: (e.g. v10.5.0) Codex version: 0.124.0

What terminal emulator and version are you using (if applicable)?

No response

What issue are you seeing?

After installing @openai/[email protected] globally, running codex results in the following error:

Error: Missing optional dependency @openai/codex-win32-x64.
Reinstall Codex: npm install -g @openai/codex@latest

What steps can reproduce the bug?

Install Codex:

npm install -g @openai/[email protected]

Run:

codex

What is the expected behavior?

Codex CLI should run normally.

Additional information

npm config get omit returns: (your value)
NODE_ENV: (your value)

Installing @openai/codex-win32-x64 directly results in:

404 Not Found
Version 0.122.x works correctly on the same environment.
Suspected Cause

It seems that the Windows-specific optional dependency (*-win32-x64) may not be properly published or resolved for version 0.124.0.

Activity

  1. added
    bug
    on Apr 24, 2026
  2. added
    CLI
    windows-os
    on Apr 24, 2026
  3. yujianfeikong commented on Apr 24, 2026

    @yujianfeikong

    I also encountered the same issue:
    Error: Missing optional dependency @openai/codex-darwin-x64. Reinstall Codex: npm install -g @openai/codex@latest

    But version 0.123.0 is normal

  4. imdoge commented on Apr 24, 2026

    @imdoge
    npm view @openai/[email protected] version
    npm warn Unknown project config "public-hoist-pattern". This will stop working in the next major version of npm.
    0.123.0-win32-x64
    
    npmview @openai/[email protected] version
    npm warn Unknown project config "public-hoist-pattern". This will stop working in the next major version of npm.
    npm error code E404
    npm error 404 No match found for version 0.124.0-win32-x64
    npm error 404
    npm error 404  The requested resource '@openai/[email protected]' could not be found or you do not have permission to access it.
    npm error 404
    npm error 404 Note that you can also install from a
    npm error 404 tarball, folder, http url, or git url.
    npm error A complete log of this run can be found in
    
  5. KISS-GG commented on Apr 24, 2026

    @KISS-GG

    same error.
    use node24.
    but node22 is all ok.

  6. davidchen27 commented on Apr 24, 2026

    @davidchen27

    I encountered the same problem, also with version 0.124.0. However, the difference is that I used volta install @openai/codex and my Node.js version was 25.6.0. Version 0.123.0 did not have this problem.

  7. FelixWardUS commented on Apr 26, 2026

    @FelixWardUS

    I hit this kind of Codex npm install/update problem a few times too, so I made a small pre-check tool:

    https://github.com/FelixWardUS/codex-npm-check

    You can try it before updating:

    npm install -g codex-npm-check
    cnc

    It checks whether the Codex npm release and its platform packages are actually available before install. It only catches npm publishing/registry problems, not runtime bugs after install.

  8. kallsu commented on Oct 4, 2026

    @kallsu

    Command run: npm install -g @openai/codex@latest

    Error:

    file:///C:/Users/XXXX/AppData/Roaming/npm/node_modules/@openai/codex/bin/codex.js:107                                    
    throw new Error(                                                                                                              
    ^                                                                                                                                                                                                                                       Error: Missing optional dependency @openai/codex-win32-x64. Reinstall Codex: npm install -g @openai/codex@latest            
    at findCodexExecutable (file:///C:/Users/giorg/AppData/Roaming/npm/node_modules/@openai/codex/bin/codex.js:107:9)       
    at file:///C:/Users/giorg/AppData/Roaming/npm/node_modules/@openai/codex/bin/codex.js:112:20        
    at ModuleJob.run (node:internal/modules/esm/module_job:439:25)                                                          
    at async node:internal/modules/esm/loader:633:26                                                                        
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)
    
    Node.js v24.17.0
    

    Node version v24.17.0
    NPM version 12.2.0
    Windows version

    > Get-ComputerInfo | Select-Object OsName, OSDisplayVersion, OsBuildNumber 
    
    OsName                                                                        OSDisplayVersion          OsBuildNumber
    ------                                                                             ----------------               -------------
    Microsoft Windows 11 Home Single Language                                                  26300

    Tentative:

    • Workaround here #19824 does not work for me.

    Solution

    1. Download manually the tgz from registry.npmjs.org

    0.16.0-win32-x64

    1. Install manually

    npm install -g <PATH_OF_MY_PC>\codex-0.160.0-win32-x64.tgz

    1. Recheck the environment variables

    C:\User\XXXX\AppData\Roaming\npm
    C:\User\XXXX\AppData\Local\Program\Codex

    1. Inspect the last one the symlink to C:\Users\giorg\.codex\packages\standalone\current\bin

    I recreated the folder current using

    New-Item -ItemType SymbolicLink -Path current -Target 'C:\Users\XXXX\AppData\Roaming\npm\node_modules\@openai\codex\vendor\x86_64-pc-windows-msvc\'
    1. Everything work perfectly.
    PowerShell 7.6.6
    PS ...> codex --version
    codex-cli 0.160.0
    1. Enjoy

    2. Probably for you, the command npm install -g @openai/[email protected] work perfectly because I had connection issues from my Internet Provider.

    Errors

    1. Installation with npm reported 2 errors, missing administrative privileges and error connection
    PS C:\Windows\System32> npm install -g @openai/codex@0.160.0-win32-x64                                                                                                               npm warn cleanup Failed to remove some directories [                                                                                                                                 npm warn cleanup   [                                                                                                                                                                 
    npm warn cleanup     '\\\\?\\C:\\Users\\XXX\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex',                                                                                 npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\giorg\AppData\Roaming\npm\node_modules\@openai\codex\vendor\x86_64-pc-windows-msvc\bin'] {              
    npm warn cleanup       errno: -4048,                                                                                                                                                
     npm warn cleanup       code: 'EPERM',                                                                                                                                                
    npm warn cleanup       syscall: 'rmdir',                                                                                                                                             
    npm warn cleanup       path: 'C:\\Users\\XXX\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\vendor\\x86_64-pc-windows-msvc\\bin'                                            
    npm warn cleanup     }                                                                                                                                                               
    npm warn cleanup   ]                                                                                                                                                                 
    npm warn cleanup ]                                                                                                                                                                   
    npm error code ECONNRESET                                                                                                                                                           
    npm error syscall read                                                                                                                                                               
    npm error errno -4077                                                                                                                                                                
    npm error network read ECONNRESET                                                                                                                                                   
    npm error network This is a problem related to network connectivity.                                                                                                                 npm error network In most cases you are behind a proxy or have bad network settings.                                                                                                 npm error network                                                                                                                                                                    
    npm error network If you are behind a proxy, please make sure that the 'proxy' config is set properly.  See: 'npm help config'                                                       npm error A complete log of this run can be found in: C:\Users\XXX\AppData\Local\npm-cache\_logs\2026-10-04T05_01_18_794Z-debug-0.log
    1. After cleaning the directory with npm prune and manually (was already empty), the error is the connection lost
    npm error code ECONNRESET                                                                                                                                                           
    npm error syscall read                                                                                                                                                               
    npm error errno -4077                                                                                                                                                                
    npm error network read ECONNRESET                                                                                                                                                   
    npm error network This is a problem related to network connectivity.                                                                                                                 npm error network In most cases you are behind a proxy or have bad network settings.                                                                                                 npm error network                                                                                                                                                                    
    npm error network If you are behind a proxy, please make sure that the 'proxy' config is set properly.  See: 'npm help config'                                                       npm error A complete log of this run can be found in: C:\Users\XXX\AppData\Local\npm-cache\_logs\.....log
    
    1. Opening the log file was evident my connection errors.
    20 http cache @openai/codex@https://registry.npmjs.org/@openai/codex/-/codex-0.160.0-win32-x64.tgz 0ms (cache hit)
    21 silly tarball no local data for @openai/codex@https://registry.npmjs.org/@openai/codex/-/codex-0.160.0-win32-x64.tgz. Extracting by manifest.
    22 verbose stack Error: read ECONNRESET
    22 verbose stack     at TLSWrap.onStreamRead (node:internal/stream_base_commons:216:20)
    23 error code ECONNRESET
    24 error syscall read
    25 error errno -4077
    26 error network read ECONNRESET
    27 error network This is a problem related to network connectivity.
    27 error network In most cases you are behind a proxy or have bad network settings.
    27 error network
    27 error network If you are behind a proxy, please make sure that the 'proxy' config is set properly.  See: 'npm help config'
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions