amazon-q-developer-cli
amazon-q-developer-cli copied to clipboard
Q CLI update fails with "Directory not empty" error on macOS
Checks
- [x] I have searched github.com/aws/amazon-q-developer-cli/issues and there are no duplicates of my issue
- [x] I have run
q doctorin the affected terminal session - [x] I have run
q restartand replicated the issue again
Operating system
macOS 15.5.0 (24F74)
Expected behaviour
Q CLI should update successfully to the latest version without directory swap errors.
Actual behaviour
Running q update fails with error: "Failed to swap app bundle: Directory not empty (os error 66)". The error persists even after running q doctor and clearing cache with rm -rf ~/.q/cache.
[chat-transcript]
> q update
I'll help you update the Q CLI. Let me run the update command for you.
[Tool uses: execute_bash]
> t
The update failed due to a directory swap issue. Let me run `q doctor` first to diagnose and potentially fix the problem, then try the update again.
[Tool uses: execute_bash]
The doctor found a shell compatibility issue. Let me try the update again anyway, as this might be a separate issue from the update problem.
[Tool uses: execute_bash]
The update is still failing with the same directory swap error. This appears to be a known issue with the Q CLI updater on macOS. Here are a few options to resolve this:
1. **Try force updating** (if available):
\```bash
q update --force
\```
2. **Manually reinstall Q CLI** by downloading the latest version from the official source
3. **Clear Q CLI cache and try again**:
\```bash
rm -rf ~/.q/cache
q update
\```
Let me try the force update option first:
[Tool uses: execute_bash]
The force flag isn't available. Let me check what options are available for the update command:
[Tool uses: execute_bash]
Let me try clearing the Q CLI cache and then updating:
[Tool uses: execute_bash]
[Tool uses: execute_bash]
The update is still failing with the same error. This appears to be a persistent issue with the Q CLI updater on macOS. The error "Directory not empty (os error 66)" suggests the updater can't replace the application bundle because there are files it can't overwrite.
At this point, you have a few options:
1. **Restart your terminal/shell** and try the update again
2. **Completely quit any running Q processes** and try again
3. **Manually reinstall Q CLI** by downloading the latest installer from AWS
4. **Report this issue** using `q issue` so the Q team can investigate
Would you like me to help you with any of these approaches?
[Tool uses: none]
> yes
Let me help you report this issue to the Q team:
[Tool uses: report_issue]
Steps to reproduce
- Run
q update2. Error occurs: "Failed to swap app bundle: Directory not empty (os error 66)" 3. Runq doctor(shows shell compatibility issue) 4. Clear cache withrm -rf ~/.q/cache5. Retryq update -y- same error persists
Environment
<This will be visible to anyone. Do not include personal or sensitive information>
[q-details]
version = "1.19.7"
hash = "cf39ab6297ee7654fcbeed253445d35fe5c92b07"
date = "2025-11-15T19:52:52.480656Z (8d ago)"
[system-info]
os = "macOS 15.5.0 (24F74)"
chip = "Apple M2 Pro"
total-cores = 10
memory = "16.00 GB"
[environment]
cwd = "/Users/dingguiwang_1"
cli-path = "/Users/dingguiwang_1"
install-method = "unknown"
[env-vars]
PATH = "/Users/dingguiwang_1/.antigravity/antigravity/bin:/Users/dingguiwang_1/.nvm/versions/node/v18.20.8/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.12/bin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/dingguiwang_1/.local/bin"
QTERM_SESSION_ID = "3ec9fb5fec9a4aefb4541a9c537c575d"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "1.19.7"
SHELL = "/bin/zsh"
TERM = "xterm-256color"
__CFBundleIdentifier = "com.apple.Terminal"
[chat-settings]
[chat-trusted_tools]
execute_bash=trusted
[chat-failed_request_ids]
none
[chat-context]
current_profile=q_cli_default
profile_context=
AmazonQ.md
AGENTS.md
README.md
.amazonq/rules/**/*.md
files=none
Any update! I have the same problem :(
son@MacBook-Pro-cua-Son ~ % q --version
q 1.19.7
son@MacBook-Pro-cua-Son ~ % q update
████████████████████████████████████████████████████████████████████████ 100/100Failed to swap files: failed to update: `Failed to swap app bundle: Directory not empty (os error 66)`
████████████████████████████████████████████████████████████████████████ 100/100error: failed to update: ``
If this is unexpected, try running q doctor and then try again.
您好!您的邮件已收到!我查阅后,尽快回复您!
I think they stopped supporting Q and switched to Kiro CLI. I just removed Q and installed Kiro CLI, and now it works fine.
curl -fsSL https://cli.kiro.dev/install | bash
Refer to this link https://kiro.dev/docs/cli/migrating-from-q/