Skip to content

EAS CLI Build Failure on Windows: EPERM Permission Error #3385

@issikaaymeric

Description

@issikaaymeric

Minimal reproducible example

eas build --platform android

Steps to reproduce

Summary
EAS CLI consistently fails during the project compression and upload phase on Windows with an EPERM: operation not permitted error when attempting to remove temporary directories in C:\temp\eas-cli-nodejs.

Environment

Environment

OS: Windows (appears to be Windows 10/11)
EAS CLI Version: Latest (as of February 2026)
Node.js: (version in use)
Project Type: Expo/React Native with Expo SDK 54
Platform: Android build
Working Directory: C:\Users\LENOVO\Desktop\social-media\mobile

Expo Doctor Diagnostics

Error Details
Error Message
Failed to upload the project tarball to EAS Build

Reason: EPERM: operation not permitted, rmdir 'C:\temp\eas-cli-nodejs\[UUID]-shallow-clone\dist'
    Error: build command failed.
- Compressing project files
Full Error Context
The error occurs consistently during the "Compressing project files and uploading to EAS Build" step, immediately after credentials are configured and the version code is incremented.
Steps to Reproduce

Set up an Expo project on Windows
Configure EAS Build: eas build:configure
Attempt to build: eas build --platform android
Build fails during compression phase with EPERM error

Troubleshooting Attempts
The following solutions were attempted without success:
1. Manual Cleanup of Temp Directory
powershellRemove-Item -Path "C:\temp\eas-cli-nodejs" -Recurse -Force -ErrorAction SilentlyContinue
Result: Error persists on next build attempt
2. Environment Variable Override
powershell$env:TMPDIR = "$HOME\temp"
$env:TEMP = "$HOME\AppData\Local\Temp"
$env:TMP = "$HOME\AppData\Local\Temp"
Result: EAS CLI continues using C:\temp instead of custom temp directory
3. Full Node Modules Reinstall
powershelltaskkill /F /IM node.exe
Remove-Item -Path ".\node_modules" -Recurse -Force
Remove-Item -Path ".\package-lock.json" -Force
npm install
Result: Same EPERM error
4. Git Repository Initialization
powershellgit init
git add .
git commit -m "Initial commit"
Result: Eliminated the "no version control" warning but EPERM error persists
5. React Version Update
powershellnpm install react@19.2.4 react-dom@19.2.4
Result: Fixed peer dependency warnings but did not resolve EPERM issue
Observations

Consistent Temp Directory: EAS CLI always uses C:\temp\eas-cli-nodejs\[UUID]-shallow-clone\dist regardless of environment variable settings
Permission-Specific: The error is specifically related to Windows file permissions (EPERM)
Cleanup Phase: The error occurs during the cleanup/removal phase after creating the shallow clone
UUID Changes: Each build attempt creates a new UUID-named directory, suggesting the issue is with cleanup, not creation
Non-Administrator Context: Running in standard PowerShell (not elevated)

Expected Behavior
EAS CLI should either:

Successfully clean up temporary directories after compression, OR
Respect custom temp directory paths set via environment variables, OR
Handle Windows permission errors gracefully and continue with the build

Additional Context
This appears to be a Windows-specific issue as the same workflow typically works without issues on macOS and Linux. The error suggests that EAS CLI may be holding file handles or attempting to remove directories before all file operations are complete.
Potential Root Cause
The issue may be related to:

Windows file locking behavior where processes hold handles longer than expected
Insufficient permissions on C:\temp directory for the current user
EAS CLI not properly releasing file handles before attempting cleanup
Race condition between file creation and cleanup operations on Windows

Workarounds Being Considered

Running PowerShell as Administrator (not yet tested)
Using WSL2 instead of native Windows
Using --local build flag if available
Manual intervention to set proper permissions on C:\temp directory

Request
Could the Expo team investigate:

Why EAS CLI doesn't respect TMPDIR, TEMP, or TMP environment variables on Windows?
Whether the cleanup process can be made more resilient to Windows file locking?
If there's a configuration option to specify a custom temp directory that actually works?
Whether file handles are being properly closed before cleanup attempts?

Related Information

Project uses Clerk authentication (@clerk/clerk-expo@2.19.21)
Project has both iOS and Android configured but only Android build attempted
Build credentials are managed remotely via Expo servers
No custom native code or modifications

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions