v2/docs/V2.7.27_RELEASE_NOTES.md
Release Date: 2025-11-06 Type: Bug Fix Release Priority: High
After v2.7.26 release, users experienced ENOTEMPTY errors when running npx claude-flow commands:
npm error code ENOTEMPTY
npm error syscall rename
npm error path /home/user/.npm/_npx/*/node_modules/agentic-flow
npm error ENOTEMPTY: directory not empty, rename '...' -> '...'
Root Causes Identified:
Impact: Affected all users running via npx, especially in:
bin/claude-flow)execute_with_retry() {
- Max retries: 3 attempts
- Exponential backoff: 2s, 4s, 8s
- ENOTEMPTY-specific error detection
- Automatic cache cleanup between retries
}
cleanup_npx_cache() {
- Removes directories older than 1 hour
- Non-destructive (preserves active operations)
- Automatic trigger on ENOTEMPTY detection
}
--yes flag to skip prompts--prefer-offline to reduce network conflictsUsers now receive actionable guidance on failures:
โ ๏ธ NPM cache conflict detected (attempt 1/3), retrying in 2s...
โ Failed after 3 attempts. Please try:
1. Clear NPX cache: rm -rf ~/.npm/_npx
2. Use global installation: npm install -g claude-flow
3. Report issue: https://github.com/ruvnet/claude-flow/issues/856
Created comprehensive test suite (tests/docker/Dockerfile.npx-test):
Test Scenarios:
Run Tests:
# Build test image
docker build -f tests/docker/Dockerfile.npx-test -t claude-flow-npx-test .
# Run concurrent execution tests
docker run --rm claude-flow-npx-test /test/test-concurrent.sh
# Run cache cleanup tests
docker run --rm claude-flow-npx-test /test/test-cache-cleanup.sh
bin/claude-flow - Added retry logic and cache cleanuppackage.json - Version bump to 2.7.27tests/docker/Dockerfile.npx-test - Docker test suitedocs/V2.7.27_RELEASE_NOTES.md - This document# Next run automatically uses v2.7.27
npx claude-flow@latest <command>
# Or use alpha tag
npx claude-flow@alpha <command>
npm update -g claude-flow
# Verify version
claude-flow --version # Should show v2.7.27
# Clear NPX cache
rm -rf ~/.npm/_npx
# Clear NPM cache
npm cache clean --force
# Retry
npx claude-flow@latest --version
The retry system only triggers on ENOTEMPTY errors, avoiding unnecessary delays for other error types:
if grep -q "ENOTEMPTY" /tmp/claude-flow-error.log; then
# Retry with exponential backoff
else
# Fail fast for other errors
fi
Cleanup only removes directories older than 1 hour to prevent disrupting concurrent operations:
find "$HOME/.npm/_npx" -type d -mmin +60 -exec rm -rf {} +
--yes: Automatically accept prompts (reduces timeout risks)--prefer-offline: Use cached packages when possible (reduces network conflicts)Before Fix:
After Fix:
If you're developing hooks that call NPX:
For CI/CD pipelines using npx claude-flow:
~/.npm directoryPotential enhancements for future versions:
If you continue to experience issues:
Full Changelog: v2.7.26...v2.7.27