npx ENOTEMPTY error on macOS when running @claude-flow/cli
- Dominant language
- TypeScript
- Stars
- 72.7k
- Forks
- 8.6k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 85
Description
## Problem
Users on macOS encounter an `ENOTEMPTY` error when running npx commands:
```
npm error code ENOTEMPTY
npm error syscall rename
npm error path /Users/.../.npm/_npx/.../node_modules/@claude-flow/cli
npm error dest /Users/.../.npm/_npx/.../node_modules/@claude-flow/.cli-YMjh8UPt
npm error errno -66
npm error ENOTEMPTY: directory not empty, rename '...'
```
## Cause
This is an npm cache corruption issue, not a claude-flow bug. It occurs when:
1. npx cache becomes corrupted during interrupted installs
2. npm tries to rename directories that aren't empty
3. File system race conditions on macOS
## Solution
Clear the npx cache:
```bash
# Remove the corrupted npx cache
rm -rf ~/.npm/_npx
# Then retry
npx @claude-flow/cli@latest --help
```
## Prevention
If this happens frequently:
```bash
# Use npm cache clean
npm cache clean --force
# Or install globally instead of using npx
npm install -g @claude-flow/cli
claude-flow --help
```
## Environment
- OS: macOS
- npm version: Various
- Node version: Various
## Labels
- documentation
- not-a-bug
- user-environment
Contributor guide
Research direction
No repository file or test is named in the issue. Start by locating the documentation for running @claude-flow/cli with npx, then compare its macOS ENOTEMPTY troubleshooting guidance with the commands and prevention steps described here; done means the relevant documentation clearly explains cache cleanup and retry options.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js
- Domain
- cli, documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100